/*
 * Copyright (c) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "imx390_cmos.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>

#ifdef HI_GPIO_I2C
#include "gpioi2c_ex.h"
#else
#include "hi_i2c.h"
#endif

#define I2C_DEV_FILE_NUM     16
#define I2C_BUF_NUM          8

static int g_fd[ISP_MAX_PIPE_NUM] = {[0 ...(ISP_MAX_PIPE_NUM - 1)] = -1};
static unsigned char g_serdes_i2c_addr[ISP_MAX_PIPE_NUM] = {[0 ...(ISP_MAX_PIPE_NUM - 1)] = 0x34};

unsigned char imx390_get_serdes_i2c_addr(VI_PIPE vi_pipe)
{
    return g_serdes_i2c_addr[vi_pipe];
}

int imx390_set_bus_ex_info(VI_PIPE vi_pipe, ISP_SNS_BUS_EX_S *serdes_info)
{
    g_serdes_i2c_addr[vi_pipe] = serdes_info->bus_addr;

    SNS_ERR_TRACE("---->pipe[%d] serdes_bus_addr[0x%x]!\n", vi_pipe, serdes_info->bus_addr);

    return HI_SUCCESS;
}

int imx390_i2c_init(VI_PIPE vi_pipe)
{
    char acDevFile[I2C_DEV_FILE_NUM] = {0};
    HI_U8 u8DevNum;

    if (g_fd[vi_pipe] >= 0) {
        return HI_SUCCESS;
    }
#ifdef HI_GPIO_I2C
    int ret;

    g_fd[vi_pipe] = open("/dev/gpioi2c_ex", O_RDONLY, S_IRUSR);
    if (g_fd[vi_pipe] < 0) {
        SNS_ERR_TRACE("Open gpioi2c_ex error!\n");
        return HI_FAILURE;
    }
#else
    int ret;
    ISP_SNS_COMMBUS_U *imx390businfo = HI_NULL;

    imx390businfo = imx390_get_bus_Info(vi_pipe);
    u8DevNum = imx390businfo->s8I2cDev;
    ret = snprintf_s(acDevFile, sizeof(acDevFile), sizeof(acDevFile) - 1, "/dev/i2c-%u", u8DevNum);
    if (ret < 0) {
        return HI_FAILURE;
    }
    g_fd[vi_pipe] = open(acDevFile, O_RDWR, S_IRUSR | S_IWUSR);
    if (g_fd[vi_pipe] < 0) {
        SNS_ERR_TRACE("Open /dev/hi_i2c_drv-%u error!\n", u8DevNum);
        return HI_FAILURE;
    }

    ret = ioctl(g_fd[vi_pipe], I2C_SLAVE_FORCE, (g_serdes_i2c_addr[vi_pipe] >> 1));
    if (ret < 0) {
        SNS_ERR_TRACE("I2C_SLAVE_FORCE error!\n");
        close(g_fd[vi_pipe]);
        g_fd[vi_pipe] = -1;
        return ret;
    }
#endif

    return HI_SUCCESS;
}

int imx390_i2c_exit(VI_PIPE vi_pipe)
{
    if (g_fd[vi_pipe] >= 0) {
        close(g_fd[vi_pipe]);
        g_fd[vi_pipe] = -1;
        return HI_SUCCESS;
    }
    return HI_FAILURE;
}

int imx390_read_register(VI_PIPE vi_pipe, HI_U32 addr)
{
    hi_unused(vi_pipe);
    hi_unused(addr);

    return HI_SUCCESS;
}

int imx390_write_register(VI_PIPE vi_pipe, HI_U32 addr, HI_U32 data)
{
    if (g_fd[vi_pipe] < 0) {
        return HI_SUCCESS;
    }

#ifdef HI_GPIO_I2C
    i2c_data.dev_addr = IMX390_I2C_ADDR;
    i2c_data.reg_addr = addr;
    i2c_data.addr_byte_num = IMX390_ADDR_BYTE;
    i2c_data.data = data;
    i2c_data.data_byte_num = IMX390_DATA_BYTE;

    ret = ioctl(g_fd[vi_pipe], GPIO_I2C_WRITE, &i2c_data);
    if (ret) {
        SNS_ERR_TRACE("GPIO-I2C write failed!\n");
        return ret;
    }
#else
    HI_U32 idx = 0;
    HI_S32 ret;
    HI_U8 buf[I2C_BUF_NUM];

    if (IMX390_ADDR_BYTE == 2) {  /* 2 byte */
        buf[idx] = (addr >> 8) & 0xff;  /* shift 8 */

        idx++;
        buf[idx] = addr & 0xff;
        idx++;
    } else {
    }

    if (IMX390_DATA_BYTE == 2) {  /* 2 byte */
    } else {
        buf[idx] = data & 0xff;
        idx++;
    }

    ret = write(g_fd[vi_pipe], buf, IMX390_ADDR_BYTE + IMX390_DATA_BYTE);
    if (ret < 0) {
        SNS_ERR_TRACE("I2C_WRITE error!\n");
        return HI_FAILURE;
    }

#endif
    return HI_SUCCESS;
}

static void delay_ms(int ms)
{
    usleep(ms * 1000); /* 1ms: 1000us */
    return;
}

void imx390_prog(VI_PIPE vi_pipe, const HI_U32 *rom)
{
    int i = 0;
    while (1) {
        HI_U32 lookup = rom[i++];
        HI_U32 addr = (lookup >> 16) & 0xFFFF; /* shift 16 */
        HI_U32 data = lookup & 0xFFFF;
        if (addr == 0xFFFE) {
            delay_ms(data);
        } else if (addr == 0xFFFF) {
            return;
        } else {
            imx390_write_register(vi_pipe, addr, data);
        }
    }
}

void imx390_standby(VI_PIPE vi_pipe)
{
    hi_unused(vi_pipe);
    return;
}

void imx390_restart(VI_PIPE vi_pipe)
{
    hi_unused(vi_pipe);
    return;
}

void imx390_linear_1080p30_init(VI_PIPE vi_pipe);

void imx390_default_reg_init(VI_PIPE vi_pipe)
{
    HI_U32 i;
    HI_S32 ret = HI_SUCCESS;
    ISP_SNS_STATE_S *pastimx390 = HI_NULL;
    pastimx390 = imx390_get_ctx(vi_pipe);
    for (i = 0; i < pastimx390->astRegsInfo[0].u32RegNum; i++) {
        ret += imx390_write_register(vi_pipe,
                                     pastimx390->astRegsInfo[0].astI2cData[i].u32RegAddr,
                                     pastimx390->astRegsInfo[0].astI2cData[i].u32Data);
    }
    if (ret != HI_SUCCESS) {
        SNS_ERR_TRACE("write register failed!\n");
    }
    return;
}

void imx390_init(VI_PIPE vi_pipe)
{
    WDR_MODE_E enWDRMode;
    HI_BOOL bInit;
    HI_S32 ret;
    ISP_SNS_STATE_S *pastimx390 = HI_NULL;
    pastimx390 = imx390_get_ctx(vi_pipe);
    bInit = pastimx390->bInit;
    enWDRMode = pastimx390->enWDRMode;

    ret = imx390_i2c_init(vi_pipe);
    if (ret != HI_SUCCESS) {
        SNS_ERR_TRACE("i2c init failed!\n");
        return;
    }
    /* When sensor first init, config all registers */
    if (bInit == HI_FALSE) {
        if (enWDRMode == WDR_MODE_NONE) {
            imx390_linear_1080p30_init(vi_pipe);
            } else {
            }
        }  else {
        /* When sensor switch mode(linear<->WDR or resolution), config different registers(if possible) */
        if (enWDRMode == WDR_MODE_NONE) {
            imx390_linear_1080p30_init(vi_pipe);
            } else {
            }
        }

    pastimx390->bInit = HI_TRUE;
    return;
}

void imx390_exit(VI_PIPE vi_pipe)
{
    HI_S32 ret;
    ret = imx390_i2c_exit(vi_pipe);
    if (ret != HI_SUCCESS) {
        SNS_ERR_TRACE("IMX390 exit failed!\n");
    }
    return;
}

/* 1080P30 and 1080P25 */
void imx390_linear_1080p30_init(VI_PIPE vi_pipe)
{
    HI_S32 ret = HI_SUCCESS;

    delay_ms(10); /* 10ms */
    ret += imx390_write_register(vi_pipe, 0x000C, 0xF2);
    ret += imx390_write_register(vi_pipe, 0x000D, 0x02);
    ret += imx390_write_register(vi_pipe, 0x000E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0010, 0xF2);
    ret += imx390_write_register(vi_pipe, 0x0011, 0x02);
    ret += imx390_write_register(vi_pipe, 0x0012, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0018, 0x24);
    ret += imx390_write_register(vi_pipe, 0x0019, 0x00);
    ret += imx390_write_register(vi_pipe, 0x001A, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x001B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0038, 0x00);
    ret += imx390_write_register(vi_pipe, 0x003C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x003D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x003E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0040, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0041, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0042, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0044, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0045, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0046, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0048, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0049, 0x00);
    ret += imx390_write_register(vi_pipe, 0x004A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x004C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x004D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x004E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0050, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0051, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0052, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0054, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0055, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0056, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0058, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0059, 0x00);
    ret += imx390_write_register(vi_pipe, 0x005A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x005C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x005D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x005E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0060, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0061, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0062, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0064, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0065, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0066, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0068, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0069, 0x00);
    ret += imx390_write_register(vi_pipe, 0x006A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0078, 0x00);
    ret += imx390_write_register(vi_pipe, 0x007C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x007D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0080, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0081, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0090, 0x00);
    ret += imx390_write_register(vi_pipe, 0x00F4, 0x1C);
    ret += imx390_write_register(vi_pipe, 0x00F5, 0xF8);
    ret += imx390_write_register(vi_pipe, 0x00F6, 0x01);
    ret += imx390_write_register(vi_pipe, 0x00F8, 0x03);
    ret += imx390_write_register(vi_pipe, 0x00F9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x00FA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x00FB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0114, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0115, 0x01);
    ret += imx390_write_register(vi_pipe, 0x0118, 0x20);
    ret += imx390_write_register(vi_pipe, 0x0119, 0x03);
    ret += imx390_write_register(vi_pipe, 0x011A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x011B, 0x41);
    ret += imx390_write_register(vi_pipe, 0x011C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x011D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0120, 0x20);
    ret += imx390_write_register(vi_pipe, 0x0121, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0122, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0123, 0x44);
    ret += imx390_write_register(vi_pipe, 0x0124, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0125, 0x01);
    ret += imx390_write_register(vi_pipe, 0x0128, 0x28);
    ret += imx390_write_register(vi_pipe, 0x0129, 0x0A);
    ret += imx390_write_register(vi_pipe, 0x012A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x012B, 0xA4);
    ret += imx390_write_register(vi_pipe, 0x012C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x012D, 0x01);
    ret += imx390_write_register(vi_pipe, 0x0130, 0xC4);
    ret += imx390_write_register(vi_pipe, 0x0131, 0x09);
    ret += imx390_write_register(vi_pipe, 0x0132, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0133, 0xDA);
    ret += imx390_write_register(vi_pipe, 0x013B, 0x01);
    ret += imx390_write_register(vi_pipe, 0x01C4, 0x00);
    ret += imx390_write_register(vi_pipe, 0x01C5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x01CC, 0x01);
    ret += imx390_write_register(vi_pipe, 0x01D0, 0x09);
    ret += imx390_write_register(vi_pipe, 0x01D4, 0x01);
    ret += imx390_write_register(vi_pipe, 0x0332, 0xD8);
    ret += imx390_write_register(vi_pipe, 0x0333, 0x02);
    ret += imx390_write_register(vi_pipe, 0x0390, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0391, 0x00);
    ret += imx390_write_register(vi_pipe, 0x0392, 0x00);
    ret += imx390_write_register(vi_pipe, 0x03C0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2000, 0x55);
    ret += imx390_write_register(vi_pipe, 0x2001, 0x55);
    ret += imx390_write_register(vi_pipe, 0x2002, 0x55);
    ret += imx390_write_register(vi_pipe, 0x2003, 0x05);
    ret += imx390_write_register(vi_pipe, 0x2004, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2008, 0x65);
    ret += imx390_write_register(vi_pipe, 0x2009, 0x04);
    ret += imx390_write_register(vi_pipe, 0x200A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x200C, 0x30);
    ret += imx390_write_register(vi_pipe, 0x200D, 0x11);
    ret += imx390_write_register(vi_pipe, 0x2010, 0x04);
    ret += imx390_write_register(vi_pipe, 0x2014, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2018, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2019, 0x04);
    ret += imx390_write_register(vi_pipe, 0x201A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x201C, 0x21);
    ret += imx390_write_register(vi_pipe, 0x201D, 0x11);
    ret += imx390_write_register(vi_pipe, 0x201E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x201F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2020, 0xBC);
    ret += imx390_write_register(vi_pipe, 0x2021, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2022, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x2023, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2024, 0xBA);
    ret += imx390_write_register(vi_pipe, 0x2025, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2026, 0x81);
    ret += imx390_write_register(vi_pipe, 0x2027, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2028, 0x7D);
    ret += imx390_write_register(vi_pipe, 0x2029, 0x90);
    ret += imx390_write_register(vi_pipe, 0x202A, 0x05);
    ret += imx390_write_register(vi_pipe, 0x202C, 0xFC);
    ret += imx390_write_register(vi_pipe, 0x202D, 0x02);
    ret += imx390_write_register(vi_pipe, 0x202E, 0x25);
    ret += imx390_write_register(vi_pipe, 0x202F, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2030, 0x05);
    ret += imx390_write_register(vi_pipe, 0x2031, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2032, 0xCA);
    ret += imx390_write_register(vi_pipe, 0x2033, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2034, 0xFC);
    ret += imx390_write_register(vi_pipe, 0x2035, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2036, 0x25);
    ret += imx390_write_register(vi_pipe, 0x2037, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2038, 0xF8);
    ret += imx390_write_register(vi_pipe, 0x2039, 0xE4);
    ret += imx390_write_register(vi_pipe, 0x203A, 0xE3);
    ret += imx390_write_register(vi_pipe, 0x203B, 0x01);
    ret += imx390_write_register(vi_pipe, 0x203C, 0xF5);
    ret += imx390_write_register(vi_pipe, 0x203D, 0x8E);
    ret += imx390_write_register(vi_pipe, 0x203E, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x203F, 0x2D);
    ret += imx390_write_register(vi_pipe, 0x2040, 0x69);
    ret += imx390_write_register(vi_pipe, 0x2041, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2042, 0x8E);
    ret += imx390_write_register(vi_pipe, 0x2043, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2044, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x2045, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2046, 0x31);
    ret += imx390_write_register(vi_pipe, 0x2047, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2048, 0x6A);
    ret += imx390_write_register(vi_pipe, 0x2049, 0x01);
    ret += imx390_write_register(vi_pipe, 0x204A, 0x8E);
    ret += imx390_write_register(vi_pipe, 0x204B, 0x01);
    ret += imx390_write_register(vi_pipe, 0x204C, 0x0D);
    ret += imx390_write_register(vi_pipe, 0x204D, 0x02);
    ret += imx390_write_register(vi_pipe, 0x204E, 0x31);
    ret += imx390_write_register(vi_pipe, 0x204F, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2050, 0x7B);
    ret += imx390_write_register(vi_pipe, 0x2051, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2052, 0x7D);
    ret += imx390_write_register(vi_pipe, 0x2053, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2054, 0x95);
    ret += imx390_write_register(vi_pipe, 0x2055, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2056, 0x97);
    ret += imx390_write_register(vi_pipe, 0x2057, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2058, 0xAD);
    ret += imx390_write_register(vi_pipe, 0x2059, 0x00);
    ret += imx390_write_register(vi_pipe, 0x205A, 0xAF);
    ret += imx390_write_register(vi_pipe, 0x205B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x205C, 0x92);
    ret += imx390_write_register(vi_pipe, 0x205D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x205E, 0x94);
    ret += imx390_write_register(vi_pipe, 0x205F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2060, 0x8E);
    ret += imx390_write_register(vi_pipe, 0x2061, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2062, 0x90);
    ret += imx390_write_register(vi_pipe, 0x2063, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2064, 0xB1);
    ret += imx390_write_register(vi_pipe, 0x2065, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2066, 0xB3);
    ret += imx390_write_register(vi_pipe, 0x2067, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2068, 0x08);
    ret += imx390_write_register(vi_pipe, 0x2069, 0x00);
    ret += imx390_write_register(vi_pipe, 0x206A, 0x04);
    ret += imx390_write_register(vi_pipe, 0x206B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x206C, 0x84);
    ret += imx390_write_register(vi_pipe, 0x206D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x206E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x206F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2070, 0x04);
    ret += imx390_write_register(vi_pipe, 0x2071, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2072, 0x46);
    ret += imx390_write_register(vi_pipe, 0x2073, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2074, 0xE9);
    ret += imx390_write_register(vi_pipe, 0x2075, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2076, 0x74);
    ret += imx390_write_register(vi_pipe, 0x2077, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2078, 0x80);
    ret += imx390_write_register(vi_pipe, 0x2079, 0x00);
    ret += imx390_write_register(vi_pipe, 0x207A, 0xC1);
    ret += imx390_write_register(vi_pipe, 0x207B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x207C, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x207D, 0x03);
    ret += imx390_write_register(vi_pipe, 0x207E, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x207F, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2080, 0x78);
    ret += imx390_write_register(vi_pipe, 0x2081, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2082, 0x6A);
    ret += imx390_write_register(vi_pipe, 0x2083, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2084, 0xE4);
    ret += imx390_write_register(vi_pipe, 0x2085, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2086, 0x2B);
    ret += imx390_write_register(vi_pipe, 0x2087, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2088, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2089, 0x00);
    ret += imx390_write_register(vi_pipe, 0x208A, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x208B, 0x03);
    ret += imx390_write_register(vi_pipe, 0x208C, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x208D, 0x03);
    ret += imx390_write_register(vi_pipe, 0x208E, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x208F, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2090, 0x7D);
    ret += imx390_write_register(vi_pipe, 0x2091, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2092, 0x62);
    ret += imx390_write_register(vi_pipe, 0x2093, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2094, 0xE9);
    ret += imx390_write_register(vi_pipe, 0x2095, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2096, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2097, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2098, 0x7C);
    ret += imx390_write_register(vi_pipe, 0x2099, 0x00);
    ret += imx390_write_register(vi_pipe, 0x209A, 0x21);
    ret += imx390_write_register(vi_pipe, 0x209B, 0x03);
    ret += imx390_write_register(vi_pipe, 0x209C, 0xE9);
    ret += imx390_write_register(vi_pipe, 0x209D, 0x01);
    ret += imx390_write_register(vi_pipe, 0x209E, 0x21);
    ret += imx390_write_register(vi_pipe, 0x209F, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20A0, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x20A1, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20A2, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x20A3, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20A4, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x20A5, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20A6, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x20A7, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20A8, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x20A9, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20AA, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x20AB, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20AC, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x20AD, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20AE, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x20AF, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20B0, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x20B1, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20B2, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x20B3, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20B4, 0x87);
    ret += imx390_write_register(vi_pipe, 0x20B5, 0xCC);
    ret += imx390_write_register(vi_pipe, 0x20B6, 0x87);
    ret += imx390_write_register(vi_pipe, 0x20B7, 0x08);
    ret += imx390_write_register(vi_pipe, 0x20B8, 0xF4);
    ret += imx390_write_register(vi_pipe, 0x20B9, 0xA5);
    ret += imx390_write_register(vi_pipe, 0x20BA, 0x07);
    ret += imx390_write_register(vi_pipe, 0x20BC, 0x1F);
    ret += imx390_write_register(vi_pipe, 0x20BD, 0x01);
    ret += imx390_write_register(vi_pipe, 0x20BE, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x20BF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20C0, 0x90);
    ret += imx390_write_register(vi_pipe, 0x20C1, 0x01);
    ret += imx390_write_register(vi_pipe, 0x20C2, 0x67);
    ret += imx390_write_register(vi_pipe, 0x20C3, 0x01);
    ret += imx390_write_register(vi_pipe, 0x20C4, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x20C5, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20C6, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x20C7, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20C8, 0x33);
    ret += imx390_write_register(vi_pipe, 0x20C9, 0x02);
    ret += imx390_write_register(vi_pipe, 0x20CA, 0x0A);
    ret += imx390_write_register(vi_pipe, 0x20CB, 0x02);
    ret += imx390_write_register(vi_pipe, 0x20CC, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x20CD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20CE, 0xD2);
    ret += imx390_write_register(vi_pipe, 0x20CF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20D0, 0x81);
    ret += imx390_write_register(vi_pipe, 0x20D1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20D2, 0x87);
    ret += imx390_write_register(vi_pipe, 0x20D3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20D4, 0x09);
    ret += imx390_write_register(vi_pipe, 0x20D5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20D8, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x20D9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20DA, 0x62);
    ret += imx390_write_register(vi_pipe, 0x20DB, 0x01);
    ret += imx390_write_register(vi_pipe, 0x20DC, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x20DD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20DE, 0x62);
    ret += imx390_write_register(vi_pipe, 0x20DF, 0x01);
    ret += imx390_write_register(vi_pipe, 0x20E0, 0x65);
    ret += imx390_write_register(vi_pipe, 0x20E1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20E2, 0x75);
    ret += imx390_write_register(vi_pipe, 0x20E3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20E4, 0xE0);
    ret += imx390_write_register(vi_pipe, 0x20E5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20E6, 0xF0);
    ret += imx390_write_register(vi_pipe, 0x20E7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20E8, 0x4C);
    ret += imx390_write_register(vi_pipe, 0x20E9, 0x01);
    ret += imx390_write_register(vi_pipe, 0x20EA, 0x5C);
    ret += imx390_write_register(vi_pipe, 0x20EB, 0x01);
    ret += imx390_write_register(vi_pipe, 0x20EC, 0xD1);
    ret += imx390_write_register(vi_pipe, 0x20ED, 0x01);
    ret += imx390_write_register(vi_pipe, 0x20EE, 0xE1);
    ret += imx390_write_register(vi_pipe, 0x20EF, 0x01);
    ret += imx390_write_register(vi_pipe, 0x20F0, 0x93);
    ret += imx390_write_register(vi_pipe, 0x20F1, 0x02);
    ret += imx390_write_register(vi_pipe, 0x20F2, 0xA3);
    ret += imx390_write_register(vi_pipe, 0x20F3, 0x02);
    ret += imx390_write_register(vi_pipe, 0x20F4, 0x0D);
    ret += imx390_write_register(vi_pipe, 0x20F5, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20F6, 0x1D);
    ret += imx390_write_register(vi_pipe, 0x20F7, 0x03);
    ret += imx390_write_register(vi_pipe, 0x20F8, 0x57);
    ret += imx390_write_register(vi_pipe, 0x20F9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20FA, 0x7B);
    ret += imx390_write_register(vi_pipe, 0x20FB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20FC, 0xD2);
    ret += imx390_write_register(vi_pipe, 0x20FD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x20FE, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x20FF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2100, 0x3E);
    ret += imx390_write_register(vi_pipe, 0x2101, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2102, 0x60);
    ret += imx390_write_register(vi_pipe, 0x2103, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2104, 0xC3);
    ret += imx390_write_register(vi_pipe, 0x2105, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2106, 0xE5);
    ret += imx390_write_register(vi_pipe, 0x2107, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2108, 0x85);
    ret += imx390_write_register(vi_pipe, 0x2109, 0x02);
    ret += imx390_write_register(vi_pipe, 0x210A, 0xA9);
    ret += imx390_write_register(vi_pipe, 0x210B, 0x02);
    ret += imx390_write_register(vi_pipe, 0x210C, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x210D, 0x02);
    ret += imx390_write_register(vi_pipe, 0x210E, 0x21);
    ret += imx390_write_register(vi_pipe, 0x210F, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2110, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2111, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2112, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2113, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2114, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2115, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2116, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2117, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2118, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2119, 0x03);
    ret += imx390_write_register(vi_pipe, 0x211A, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x211B, 0x03);
    ret += imx390_write_register(vi_pipe, 0x211C, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x211D, 0x03);
    ret += imx390_write_register(vi_pipe, 0x211E, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x211F, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2120, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2121, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2122, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2123, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2124, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2125, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2126, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2127, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2128, 0x7D);
    ret += imx390_write_register(vi_pipe, 0x2129, 0x90);
    ret += imx390_write_register(vi_pipe, 0x212A, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x212B, 0x07);
    ret += imx390_write_register(vi_pipe, 0x212C, 0x64);
    ret += imx390_write_register(vi_pipe, 0x212D, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2130, 0x5F);
    ret += imx390_write_register(vi_pipe, 0x2131, 0x7D);
    ret += imx390_write_register(vi_pipe, 0x2132, 0x05);
    ret += imx390_write_register(vi_pipe, 0x2134, 0x78);
    ret += imx390_write_register(vi_pipe, 0x2135, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2136, 0x76);
    ret += imx390_write_register(vi_pipe, 0x2137, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2138, 0xF3);
    ret += imx390_write_register(vi_pipe, 0x2139, 0x00);
    ret += imx390_write_register(vi_pipe, 0x213A, 0xF1);
    ret += imx390_write_register(vi_pipe, 0x213B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x213C, 0xA6);
    ret += imx390_write_register(vi_pipe, 0x213D, 0x02);
    ret += imx390_write_register(vi_pipe, 0x213E, 0xA4);
    ret += imx390_write_register(vi_pipe, 0x213F, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2140, 0x7D);
    ret += imx390_write_register(vi_pipe, 0x2141, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2142, 0x8D);
    ret += imx390_write_register(vi_pipe, 0x2143, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2144, 0xA1);
    ret += imx390_write_register(vi_pipe, 0x2145, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2146, 0xB1);
    ret += imx390_write_register(vi_pipe, 0x2147, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2148, 0xAB);
    ret += imx390_write_register(vi_pipe, 0x2149, 0x02);
    ret += imx390_write_register(vi_pipe, 0x214A, 0xBB);
    ret += imx390_write_register(vi_pipe, 0x214B, 0x02);
    ret += imx390_write_register(vi_pipe, 0x214C, 0x17);
    ret += imx390_write_register(vi_pipe, 0x214D, 0x5C);
    ret += imx390_write_register(vi_pipe, 0x214E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2150, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2151, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2152, 0xF8);
    ret += imx390_write_register(vi_pipe, 0x2153, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2154, 0x45);
    ret += imx390_write_register(vi_pipe, 0x2155, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2156, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2157, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2158, 0x25);
    ret += imx390_write_register(vi_pipe, 0x2159, 0x00);
    ret += imx390_write_register(vi_pipe, 0x215A, 0x7D);
    ret += imx390_write_register(vi_pipe, 0x215B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x215C, 0x62);
    ret += imx390_write_register(vi_pipe, 0x215D, 0x01);
    ret += imx390_write_register(vi_pipe, 0x215E, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x215F, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2160, 0x26);
    ret += imx390_write_register(vi_pipe, 0x2161, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2162, 0x7D);
    ret += imx390_write_register(vi_pipe, 0x2163, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2164, 0x63);
    ret += imx390_write_register(vi_pipe, 0x2165, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2166, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2167, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2168, 0xCB);
    ret += imx390_write_register(vi_pipe, 0x2169, 0x02);
    ret += imx390_write_register(vi_pipe, 0x216A, 0xCF);
    ret += imx390_write_register(vi_pipe, 0x216B, 0x02);
    ret += imx390_write_register(vi_pipe, 0x216C, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x216D, 0x03);
    ret += imx390_write_register(vi_pipe, 0x216E, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x216F, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2170, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2171, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2172, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2173, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2174, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2175, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2176, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2177, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2178, 0x7E);
    ret += imx390_write_register(vi_pipe, 0x2179, 0x00);
    ret += imx390_write_register(vi_pipe, 0x217A, 0xBD);
    ret += imx390_write_register(vi_pipe, 0x217B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x217C, 0xEC);
    ret += imx390_write_register(vi_pipe, 0x217D, 0x01);
    ret += imx390_write_register(vi_pipe, 0x217E, 0x7B);
    ret += imx390_write_register(vi_pipe, 0x217F, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2180, 0xD1);
    ret += imx390_write_register(vi_pipe, 0x2181, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2182, 0x25);
    ret += imx390_write_register(vi_pipe, 0x2183, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2184, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x2185, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2186, 0xBD);
    ret += imx390_write_register(vi_pipe, 0x2187, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2188, 0xED);
    ret += imx390_write_register(vi_pipe, 0x2189, 0x01);
    ret += imx390_write_register(vi_pipe, 0x218A, 0x7B);
    ret += imx390_write_register(vi_pipe, 0x218B, 0x02);
    ret += imx390_write_register(vi_pipe, 0x218C, 0xD2);
    ret += imx390_write_register(vi_pipe, 0x218D, 0x02);
    ret += imx390_write_register(vi_pipe, 0x218E, 0x25);
    ret += imx390_write_register(vi_pipe, 0x218F, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2190, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2191, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2192, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2193, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2194, 0xE9);
    ret += imx390_write_register(vi_pipe, 0x2195, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2196, 0x21);
    ret += imx390_write_register(vi_pipe, 0x2197, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2198, 0x17);
    ret += imx390_write_register(vi_pipe, 0x2199, 0xFC);
    ret += imx390_write_register(vi_pipe, 0x219A, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x219B, 0x01);
    ret += imx390_write_register(vi_pipe, 0x219C, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x219D, 0x03);
    ret += imx390_write_register(vi_pipe, 0x21A0, 0x1B);
    ret += imx390_write_register(vi_pipe, 0x21A1, 0x1B);
    ret += imx390_write_register(vi_pipe, 0x21A2, 0x1B);
    ret += imx390_write_register(vi_pipe, 0x21A3, 0x01);
    ret += imx390_write_register(vi_pipe, 0x21A4, 0x2E);
    ret += imx390_write_register(vi_pipe, 0x21A5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x21A6, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21A8, 0x04);
    ret += imx390_write_register(vi_pipe, 0x21A9, 0x98);
    ret += imx390_write_register(vi_pipe, 0x21AA, 0x60);
    ret += imx390_write_register(vi_pipe, 0x21AB, 0x03);
    ret += imx390_write_register(vi_pipe, 0x21AC, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x21AD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x21AE, 0x09);
    ret += imx390_write_register(vi_pipe, 0x21B0, 0x1C);
    ret += imx390_write_register(vi_pipe, 0x21B1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21B2, 0xA0);
    ret += imx390_write_register(vi_pipe, 0x21B3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21B4, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x21B5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21B6, 0x2D);
    ret += imx390_write_register(vi_pipe, 0x21B7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21B8, 0x20);
    ret += imx390_write_register(vi_pipe, 0x21B9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21BA, 0x02);
    ret += imx390_write_register(vi_pipe, 0x21BB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21BC, 0xCC);
    ret += imx390_write_register(vi_pipe, 0x21BD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21BE, 0x4A);
    ret += imx390_write_register(vi_pipe, 0x21BF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21C0, 0xD0);
    ret += imx390_write_register(vi_pipe, 0x21C1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21C2, 0x44);
    ret += imx390_write_register(vi_pipe, 0x21C3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21C4, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21C5, 0xE0);
    ret += imx390_write_register(vi_pipe, 0x21C6, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21C8, 0x11);
    ret += imx390_write_register(vi_pipe, 0x21C9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21CA, 0x02);
    ret += imx390_write_register(vi_pipe, 0x21CC, 0x08);
    ret += imx390_write_register(vi_pipe, 0x21CD, 0xC0);
    ret += imx390_write_register(vi_pipe, 0x21CE, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x21D0, 0x44);
    ret += imx390_write_register(vi_pipe, 0x21D1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21D2, 0x02);
    ret += imx390_write_register(vi_pipe, 0x21D4, 0x02);
    ret += imx390_write_register(vi_pipe, 0x21D5, 0x20);
    ret += imx390_write_register(vi_pipe, 0x21D6, 0x2C);
    ret += imx390_write_register(vi_pipe, 0x21D8, 0xFE);
    ret += imx390_write_register(vi_pipe, 0x21D9, 0x9D);
    ret += imx390_write_register(vi_pipe, 0x21DA, 0xDF);
    ret += imx390_write_register(vi_pipe, 0x21DB, 0x03);
    ret += imx390_write_register(vi_pipe, 0x21DC, 0x62);
    ret += imx390_write_register(vi_pipe, 0x21DD, 0x01);
    ret += imx390_write_register(vi_pipe, 0x21DE, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x21DF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21E0, 0xB7);
    ret += imx390_write_register(vi_pipe, 0x21E1, 0x01);
    ret += imx390_write_register(vi_pipe, 0x21E2, 0xB5);
    ret += imx390_write_register(vi_pipe, 0x21E3, 0x01);
    ret += imx390_write_register(vi_pipe, 0x21E4, 0xC1);
    ret += imx390_write_register(vi_pipe, 0x21E5, 0x02);
    ret += imx390_write_register(vi_pipe, 0x21E6, 0xBF);
    ret += imx390_write_register(vi_pipe, 0x21E7, 0x02);
    ret += imx390_write_register(vi_pipe, 0x21E8, 0xB3);
    ret += imx390_write_register(vi_pipe, 0x21E9, 0x4D);
    ret += imx390_write_register(vi_pipe, 0x21EA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21EB, 0x04);
    ret += imx390_write_register(vi_pipe, 0x21EC, 0x90);
    ret += imx390_write_register(vi_pipe, 0x21ED, 0x07);
    ret += imx390_write_register(vi_pipe, 0x21EE, 0x58);
    ret += imx390_write_register(vi_pipe, 0x21EF, 0x04);
    ret += imx390_write_register(vi_pipe, 0x21F0, 0x54);
    ret += imx390_write_register(vi_pipe, 0x21F1, 0x04);
    ret += imx390_write_register(vi_pipe, 0x21F4, 0x02);
    ret += imx390_write_register(vi_pipe, 0x21F5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21F6, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21F8, 0x3C);
    ret += imx390_write_register(vi_pipe, 0x21F9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21FC, 0x28);
    ret += imx390_write_register(vi_pipe, 0x21FD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x21FE, 0x3C);
    ret += imx390_write_register(vi_pipe, 0x21FF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2200, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2204, 0x4C);
    ret += imx390_write_register(vi_pipe, 0x2205, 0x04);
    ret += imx390_write_register(vi_pipe, 0x2206, 0x65);
    ret += imx390_write_register(vi_pipe, 0x2207, 0x04);
    ret += imx390_write_register(vi_pipe, 0x2208, 0x0A);
    ret += imx390_write_register(vi_pipe, 0x2209, 0x00);
    ret += imx390_write_register(vi_pipe, 0x220C, 0x47);
    ret += imx390_write_register(vi_pipe, 0x220D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x220E, 0x1F);
    ret += imx390_write_register(vi_pipe, 0x220F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2210, 0x17);
    ret += imx390_write_register(vi_pipe, 0x2211, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2212, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x2213, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2214, 0x17);
    ret += imx390_write_register(vi_pipe, 0x2215, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2216, 0x47);
    ret += imx390_write_register(vi_pipe, 0x2217, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2218, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x2219, 0x00);
    ret += imx390_write_register(vi_pipe, 0x221A, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x221B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x221C, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2220, 0x20);
    ret += imx390_write_register(vi_pipe, 0x2221, 0x20);
    ret += imx390_write_register(vi_pipe, 0x2222, 0x22);
    ret += imx390_write_register(vi_pipe, 0x2223, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2224, 0xA7);
    ret += imx390_write_register(vi_pipe, 0x2225, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x2226, 0x80);
    ret += imx390_write_register(vi_pipe, 0x2227, 0x08);
    ret += imx390_write_register(vi_pipe, 0x2228, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2260, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2261, 0x1F);
    ret += imx390_write_register(vi_pipe, 0x2262, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2263, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2264, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2265, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2266, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2267, 0x1F);
    ret += imx390_write_register(vi_pipe, 0x2268, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2269, 0x00);
    ret += imx390_write_register(vi_pipe, 0x226A, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x226B, 0x1F);
    ret += imx390_write_register(vi_pipe, 0x226C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x226D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x226E, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x226F, 0x1F);
    ret += imx390_write_register(vi_pipe, 0x227C, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x227D, 0x1F);
    ret += imx390_write_register(vi_pipe, 0x227E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x227F, 0x10);
    ret += imx390_write_register(vi_pipe, 0x2280, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2281, 0x1F);
    ret += imx390_write_register(vi_pipe, 0x2282, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2283, 0x10);
    ret += imx390_write_register(vi_pipe, 0x2284, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x2285, 0x1F);
    ret += imx390_write_register(vi_pipe, 0x2286, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2287, 0x10);
    ret += imx390_write_register(vi_pipe, 0x22B2, 0x92);
    ret += imx390_write_register(vi_pipe, 0x22B4, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22B5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22B6, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22B7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22B8, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22B9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22BA, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22BB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22BC, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22BD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22BE, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22BF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22C0, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22C1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22C2, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22C3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22C4, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22C5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22C6, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22C7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22C8, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22C9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22CA, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22CB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22CC, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22CD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22CE, 0x20);
    ret += imx390_write_register(vi_pipe, 0x22CF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22DA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x22EF, 0x82);
    ret += imx390_write_register(vi_pipe, 0x2308, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2310, 0x73);
    ret += imx390_write_register(vi_pipe, 0x2311, 0x09);
    ret += imx390_write_register(vi_pipe, 0x2318, 0x40);
    ret += imx390_write_register(vi_pipe, 0x2319, 0xCD);
    ret += imx390_write_register(vi_pipe, 0x231A, 0x54);
    ret += imx390_write_register(vi_pipe, 0x2324, 0x20);
    ret += imx390_write_register(vi_pipe, 0x2325, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2328, 0x00);
    ret += imx390_write_register(vi_pipe, 0x234A, 0x9F);
    ret += imx390_write_register(vi_pipe, 0x234B, 0x07);
    ret += imx390_write_register(vi_pipe, 0x2354, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x23C0, 0x5D);
    ret += imx390_write_register(vi_pipe, 0x244C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x244D, 0x02);
    ret += imx390_write_register(vi_pipe, 0x244E, 0x54);
    ret += imx390_write_register(vi_pipe, 0x244F, 0x02);
    ret += imx390_write_register(vi_pipe, 0x24A0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x24A4, 0x16);
    ret += imx390_write_register(vi_pipe, 0x24A5, 0x01);
    ret += imx390_write_register(vi_pipe, 0x24A6, 0xA6);
    ret += imx390_write_register(vi_pipe, 0x24A7, 0x02);
    ret += imx390_write_register(vi_pipe, 0x24A8, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x24A9, 0x02);
    ret += imx390_write_register(vi_pipe, 0x24BC, 0x17);
    ret += imx390_write_register(vi_pipe, 0x24BD, 0x01);
    ret += imx390_write_register(vi_pipe, 0x24BE, 0xA7);
    ret += imx390_write_register(vi_pipe, 0x24BF, 0x02);
    ret += imx390_write_register(vi_pipe, 0x24C0, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x24C1, 0x02);
    ret += imx390_write_register(vi_pipe, 0x24DA, 0x6F);
    ret += imx390_write_register(vi_pipe, 0x24DB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x24DC, 0x62);
    ret += imx390_write_register(vi_pipe, 0x24DD, 0x01);
    ret += imx390_write_register(vi_pipe, 0x24EA, 0x32);
    ret += imx390_write_register(vi_pipe, 0x24EB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x24EC, 0xDC);
    ret += imx390_write_register(vi_pipe, 0x24ED, 0x00);
    ret += imx390_write_register(vi_pipe, 0x24FA, 0x32);
    ret += imx390_write_register(vi_pipe, 0x24FB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x24FC, 0xDD);
    ret += imx390_write_register(vi_pipe, 0x24FD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x254A, 0x15);
    ret += imx390_write_register(vi_pipe, 0x254B, 0x01);
    ret += imx390_write_register(vi_pipe, 0x255A, 0x15);
    ret += imx390_write_register(vi_pipe, 0x255B, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2560, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2561, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2562, 0x2A);
    ret += imx390_write_register(vi_pipe, 0x2563, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2564, 0xF8);
    ret += imx390_write_register(vi_pipe, 0x2565, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2566, 0x15);
    ret += imx390_write_register(vi_pipe, 0x2567, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2568, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x2569, 0x02);
    ret += imx390_write_register(vi_pipe, 0x256A, 0x31);
    ret += imx390_write_register(vi_pipe, 0x256B, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2578, 0x90);
    ret += imx390_write_register(vi_pipe, 0x2579, 0x01);
    ret += imx390_write_register(vi_pipe, 0x257A, 0x92);
    ret += imx390_write_register(vi_pipe, 0x257B, 0x01);
    ret += imx390_write_register(vi_pipe, 0x257C, 0xB8);
    ret += imx390_write_register(vi_pipe, 0x257D, 0x02);
    ret += imx390_write_register(vi_pipe, 0x257E, 0xBA);
    ret += imx390_write_register(vi_pipe, 0x257F, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2584, 0x90);
    ret += imx390_write_register(vi_pipe, 0x2585, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2586, 0x92);
    ret += imx390_write_register(vi_pipe, 0x2587, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2588, 0xB8);
    ret += imx390_write_register(vi_pipe, 0x2589, 0x02);
    ret += imx390_write_register(vi_pipe, 0x258A, 0xBA);
    ret += imx390_write_register(vi_pipe, 0x258B, 0x02);
    ret += imx390_write_register(vi_pipe, 0x267A, 0xF8);
    ret += imx390_write_register(vi_pipe, 0x267B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x267C, 0x16);
    ret += imx390_write_register(vi_pipe, 0x267D, 0x01);
    ret += imx390_write_register(vi_pipe, 0x267E, 0xA6);
    ret += imx390_write_register(vi_pipe, 0x267F, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2680, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x2681, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2690, 0xF8);
    ret += imx390_write_register(vi_pipe, 0x2691, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2694, 0xA6);
    ret += imx390_write_register(vi_pipe, 0x2695, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2696, 0x16);
    ret += imx390_write_register(vi_pipe, 0x2697, 0x01);
    ret += imx390_write_register(vi_pipe, 0x269A, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x269B, 0x02);
    ret += imx390_write_register(vi_pipe, 0x26B8, 0x10);
    ret += imx390_write_register(vi_pipe, 0x26B9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x26BA, 0x33);
    ret += imx390_write_register(vi_pipe, 0x26BB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x26BC, 0x89);
    ret += imx390_write_register(vi_pipe, 0x26BD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x26BE, 0xB0);
    ret += imx390_write_register(vi_pipe, 0x26BF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x26C4, 0x4E);
    ret += imx390_write_register(vi_pipe, 0x26C5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x26C8, 0xC9);
    ret += imx390_write_register(vi_pipe, 0x26C9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x26CC, 0x35);
    ret += imx390_write_register(vi_pipe, 0x26CD, 0x01);
    ret += imx390_write_register(vi_pipe, 0x26D0, 0xBA);
    ret += imx390_write_register(vi_pipe, 0x26D1, 0x01);
    ret += imx390_write_register(vi_pipe, 0x26D4, 0x7C);
    ret += imx390_write_register(vi_pipe, 0x26D5, 0x02);
    ret += imx390_write_register(vi_pipe, 0x26D8, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x26D9, 0x02);
    ret += imx390_write_register(vi_pipe, 0x26DE, 0x51);
    ret += imx390_write_register(vi_pipe, 0x26DF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x26E0, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x26E1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x26E2, 0xCC);
    ret += imx390_write_register(vi_pipe, 0x26E3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x26E4, 0xF8);
    ret += imx390_write_register(vi_pipe, 0x26E5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x26E6, 0x38);
    ret += imx390_write_register(vi_pipe, 0x26E7, 0x01);
    ret += imx390_write_register(vi_pipe, 0x26E8, 0x65);
    ret += imx390_write_register(vi_pipe, 0x26E9, 0x01);
    ret += imx390_write_register(vi_pipe, 0x26EA, 0xBD);
    ret += imx390_write_register(vi_pipe, 0x26EB, 0x01);
    ret += imx390_write_register(vi_pipe, 0x26EE, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x26EF, 0x02);
    ret += imx390_write_register(vi_pipe, 0x26F0, 0xAB);
    ret += imx390_write_register(vi_pipe, 0x26F1, 0x02);
    ret += imx390_write_register(vi_pipe, 0x26F2, 0xF9);
    ret += imx390_write_register(vi_pipe, 0x26F3, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2722, 0x59);
    ret += imx390_write_register(vi_pipe, 0x2723, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2938, 0x55);
    ret += imx390_write_register(vi_pipe, 0x2939, 0x00);
    ret += imx390_write_register(vi_pipe, 0x293A, 0x17);
    ret += imx390_write_register(vi_pipe, 0x293B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x293C, 0xD0);
    ret += imx390_write_register(vi_pipe, 0x293D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x293E, 0x91);
    ret += imx390_write_register(vi_pipe, 0x293F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2940, 0x3C);
    ret += imx390_write_register(vi_pipe, 0x2941, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2942, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x2943, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2944, 0xC1);
    ret += imx390_write_register(vi_pipe, 0x2945, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2946, 0x76);
    ret += imx390_write_register(vi_pipe, 0x2947, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2948, 0x83);
    ret += imx390_write_register(vi_pipe, 0x2949, 0x02);
    ret += imx390_write_register(vi_pipe, 0x294A, 0xFB);
    ret += imx390_write_register(vi_pipe, 0x294B, 0x01);
    ret += imx390_write_register(vi_pipe, 0x294C, 0xFD);
    ret += imx390_write_register(vi_pipe, 0x294D, 0x02);
    ret += imx390_write_register(vi_pipe, 0x294E, 0xBF);
    ret += imx390_write_register(vi_pipe, 0x294F, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2A06, 0x25);
    ret += imx390_write_register(vi_pipe, 0x2A07, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2A0C, 0xBE);
    ret += imx390_write_register(vi_pipe, 0x2A0D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2A0E, 0x7D);
    ret += imx390_write_register(vi_pipe, 0x2A0F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2A20, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2A21, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2A22, 0x7D);
    ret += imx390_write_register(vi_pipe, 0x2A23, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2B11, 0x19);
    ret += imx390_write_register(vi_pipe, 0x2B13, 0x15);
    ret += imx390_write_register(vi_pipe, 0x2B14, 0x14);
    ret += imx390_write_register(vi_pipe, 0x2B15, 0x13);
    ret += imx390_write_register(vi_pipe, 0x2B16, 0x12);
    ret += imx390_write_register(vi_pipe, 0x2B17, 0x11);
    ret += imx390_write_register(vi_pipe, 0x2B18, 0x10);
    ret += imx390_write_register(vi_pipe, 0x2B19, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x2B1A, 0x0E);
    ret += imx390_write_register(vi_pipe, 0x2B1B, 0x0D);
    ret += imx390_write_register(vi_pipe, 0x2B1C, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x2B1D, 0x0B);
    ret += imx390_write_register(vi_pipe, 0x2B1E, 0x0A);
    ret += imx390_write_register(vi_pipe, 0x2B1F, 0x09);
    ret += imx390_write_register(vi_pipe, 0x2B20, 0x08);
    ret += imx390_write_register(vi_pipe, 0x2B21, 0x07);
    ret += imx390_write_register(vi_pipe, 0x2B22, 0x06);
    ret += imx390_write_register(vi_pipe, 0x2B23, 0x05);
    ret += imx390_write_register(vi_pipe, 0x2B24, 0x04);
    ret += imx390_write_register(vi_pipe, 0x2B25, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2B26, 0x03);
    ret += imx390_write_register(vi_pipe, 0x2B38, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2B45, 0xE3);
    ret += imx390_write_register(vi_pipe, 0x2B50, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2B51, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2B6D, 0x47);
    ret += imx390_write_register(vi_pipe, 0x2B70, 0x04);
    ret += imx390_write_register(vi_pipe, 0x2B71, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2B72, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2B7B, 0x42);
    ret += imx390_write_register(vi_pipe, 0x2B7F, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x2B80, 0x94);
    ret += imx390_write_register(vi_pipe, 0x2B81, 0x06);
    ret += imx390_write_register(vi_pipe, 0x2B87, 0x1B);
    ret += imx390_write_register(vi_pipe, 0x2B88, 0x1A);
    ret += imx390_write_register(vi_pipe, 0x2B89, 0x17);
    ret += imx390_write_register(vi_pipe, 0x2B8A, 0x12);
    ret += imx390_write_register(vi_pipe, 0x2B8B, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2B8D, 0x2B);
    ret += imx390_write_register(vi_pipe, 0x2B8E, 0x2B);
    ret += imx390_write_register(vi_pipe, 0x2B8F, 0x1B);
    ret += imx390_write_register(vi_pipe, 0x2B90, 0xBF);
    ret += imx390_write_register(vi_pipe, 0x2B91, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x2B92, 0x73);
    ret += imx390_write_register(vi_pipe, 0x2B93, 0x0E);
    ret += imx390_write_register(vi_pipe, 0x2B94, 0xBF);
    ret += imx390_write_register(vi_pipe, 0x2B95, 0x07);
    ret += imx390_write_register(vi_pipe, 0x2B96, 0x73);
    ret += imx390_write_register(vi_pipe, 0x2B97, 0x0E);
    ret += imx390_write_register(vi_pipe, 0x2B98, 0xBF);
    ret += imx390_write_register(vi_pipe, 0x2B99, 0x57);
    ret += imx390_write_register(vi_pipe, 0x2B9B, 0x2A);
    ret += imx390_write_register(vi_pipe, 0x2BA8, 0xBC);
    ret += imx390_write_register(vi_pipe, 0x2BA9, 0x62);
    ret += imx390_write_register(vi_pipe, 0x2BC5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x2BD5, 0x30);
    ret += imx390_write_register(vi_pipe, 0x2BD6, 0xF0);
    ret += imx390_write_register(vi_pipe, 0x2BD8, 0x5B);
    ret += imx390_write_register(vi_pipe, 0x2BD9, 0xF0);
    ret += imx390_write_register(vi_pipe, 0x2BDA, 0x21);
    ret += imx390_write_register(vi_pipe, 0x2BDB, 0x0E);
    ret += imx390_write_register(vi_pipe, 0x2BDC, 0x5E);
    ret += imx390_write_register(vi_pipe, 0x2BFE, 0x02);
    ret += imx390_write_register(vi_pipe, 0x2BFF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2C98, 0xE1);
    ret += imx390_write_register(vi_pipe, 0x2C99, 0x2E);
    ret += imx390_write_register(vi_pipe, 0x2C9B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x2CA9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x2CAA, 0x01);
    ret += imx390_write_register(vi_pipe, 0x2CBF, 0x08);
    ret += imx390_write_register(vi_pipe, 0x2D39, 0x0E);
    ret += imx390_write_register(vi_pipe, 0x2D50, 0x80);
    ret += imx390_write_register(vi_pipe, 0x2D54, 0x00);
    ret += imx390_write_register(vi_pipe, 0x2D5B, 0x58);
    ret += imx390_write_register(vi_pipe, 0x2DFD, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3000, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3001, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3002, 0x23);
    ret += imx390_write_register(vi_pipe, 0x3003, 0xA1);
    ret += imx390_write_register(vi_pipe, 0x3004, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3005, 0x20);
    ret += imx390_write_register(vi_pipe, 0x3006, 0x84);
    ret += imx390_write_register(vi_pipe, 0x3007, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3008, 0x06);
    ret += imx390_write_register(vi_pipe, 0x3009, 0xB4);
    ret += imx390_write_register(vi_pipe, 0x300A, 0x1F);
    ret += imx390_write_register(vi_pipe, 0x300B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x300C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x300D, 0x1B);
    ret += imx390_write_register(vi_pipe, 0x300E, 0x90);
    ret += imx390_write_register(vi_pipe, 0x300F, 0x97);
    ret += imx390_write_register(vi_pipe, 0x3010, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3011, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3012, 0x21);
    ret += imx390_write_register(vi_pipe, 0x3013, 0x21);
    ret += imx390_write_register(vi_pipe, 0x3014, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3015, 0x20);
    ret += imx390_write_register(vi_pipe, 0x3016, 0x84);
    ret += imx390_write_register(vi_pipe, 0x3017, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3018, 0x30);
    ret += imx390_write_register(vi_pipe, 0x3019, 0x09);
    ret += imx390_write_register(vi_pipe, 0x301A, 0x46);
    ret += imx390_write_register(vi_pipe, 0x301B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x30A0, 0xCD);
    ret += imx390_write_register(vi_pipe, 0x30A1, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x30A2, 0xBA);
    ret += imx390_write_register(vi_pipe, 0x30A3, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x30A4, 0x5F);
    ret += imx390_write_register(vi_pipe, 0x30A5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x30A6, 0x43);
    ret += imx390_write_register(vi_pipe, 0x30A7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x30A8, 0xC8);
    ret += imx390_write_register(vi_pipe, 0x30A9, 0x0A);
    ret += imx390_write_register(vi_pipe, 0x30AA, 0x0B);
    ret += imx390_write_register(vi_pipe, 0x30AB, 0x08);
    ret += imx390_write_register(vi_pipe, 0x30AC, 0x4B);
    ret += imx390_write_register(vi_pipe, 0x30AD, 0x03);
    ret += imx390_write_register(vi_pipe, 0x30AE, 0x37);
    ret += imx390_write_register(vi_pipe, 0x30AF, 0x03);
    ret += imx390_write_register(vi_pipe, 0x30B0, 0x65);
    ret += imx390_write_register(vi_pipe, 0x30B1, 0x09);
    ret += imx390_write_register(vi_pipe, 0x30B2, 0x7A);
    ret += imx390_write_register(vi_pipe, 0x30B3, 0x09);
    ret += imx390_write_register(vi_pipe, 0x30B4, 0x20);
    ret += imx390_write_register(vi_pipe, 0x30B5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x30B6, 0x28);
    ret += imx390_write_register(vi_pipe, 0x30B7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x30B8, 0x91);
    ret += imx390_write_register(vi_pipe, 0x30B9, 0x04);
    ret += imx390_write_register(vi_pipe, 0x30BA, 0x75);
    ret += imx390_write_register(vi_pipe, 0x30BB, 0x05);
    ret += imx390_write_register(vi_pipe, 0x30BC, 0x7C);
    ret += imx390_write_register(vi_pipe, 0x30BD, 0x01);
    ret += imx390_write_register(vi_pipe, 0x30BE, 0x87);
    ret += imx390_write_register(vi_pipe, 0x30BF, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3410, 0x90);
    ret += imx390_write_register(vi_pipe, 0x3411, 0x07);
    ret += imx390_write_register(vi_pipe, 0x3418, 0x48);
    ret += imx390_write_register(vi_pipe, 0x3419, 0x04);
    ret += imx390_write_register(vi_pipe, 0x34BE, 0x7A);
    ret += imx390_write_register(vi_pipe, 0x34BF, 0x02);
    ret += imx390_write_register(vi_pipe, 0x3584, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3586, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3587, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3588, 0xE6);
    ret += imx390_write_register(vi_pipe, 0x3589, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3590, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3591, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3594, 0x40);
    ret += imx390_write_register(vi_pipe, 0x3598, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3599, 0x00);
    ret += imx390_write_register(vi_pipe, 0x359A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x359B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x359C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x359D, 0x01);
    ret += imx390_write_register(vi_pipe, 0x359E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x359F, 0x02);
    ret += imx390_write_register(vi_pipe, 0x35A0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35A1, 0x04);
    ret += imx390_write_register(vi_pipe, 0x35A2, 0x20);
    ret += imx390_write_register(vi_pipe, 0x35A3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35A4, 0x40);
    ret += imx390_write_register(vi_pipe, 0x35A5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35A6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x35A7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35A8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35A9, 0x01);
    ret += imx390_write_register(vi_pipe, 0x35AC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x35AD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35AE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35AF, 0x01);
    ret += imx390_write_register(vi_pipe, 0x35B0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35B1, 0x02);
    ret += imx390_write_register(vi_pipe, 0x35B2, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35B3, 0x04);
    ret += imx390_write_register(vi_pipe, 0x35B4, 0x02);
    ret += imx390_write_register(vi_pipe, 0x35B5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35B6, 0x04);
    ret += imx390_write_register(vi_pipe, 0x35B7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35B8, 0x08);
    ret += imx390_write_register(vi_pipe, 0x35B9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35BA, 0x10);
    ret += imx390_write_register(vi_pipe, 0x35BB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35C8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35C9, 0x01);
    ret += imx390_write_register(vi_pipe, 0x35CA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35CB, 0x04);
    ret += imx390_write_register(vi_pipe, 0x35CC, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35CD, 0x10);
    ret += imx390_write_register(vi_pipe, 0x35CE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35CF, 0x40);
    ret += imx390_write_register(vi_pipe, 0x35D0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35D1, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x35D2, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35D3, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x35D4, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35D5, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x35D6, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35D7, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x35D8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35D9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35DA, 0x08);
    ret += imx390_write_register(vi_pipe, 0x35DB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35DC, 0xD8);
    ret += imx390_write_register(vi_pipe, 0x35DD, 0x0E);
    ret += imx390_write_register(vi_pipe, 0x35F0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35F1, 0x10);
    ret += imx390_write_register(vi_pipe, 0x35F2, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35F3, 0x10);
    ret += imx390_write_register(vi_pipe, 0x35F4, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35F5, 0x10);
    ret += imx390_write_register(vi_pipe, 0x35F6, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35F7, 0x03);
    ret += imx390_write_register(vi_pipe, 0x35F8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35F9, 0x02);
    ret += imx390_write_register(vi_pipe, 0x35FA, 0x38);
    ret += imx390_write_register(vi_pipe, 0x35FB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35FC, 0xB3);
    ret += imx390_write_register(vi_pipe, 0x35FD, 0x01);
    ret += imx390_write_register(vi_pipe, 0x35FE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x35FF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3600, 0x04);
    ret += imx390_write_register(vi_pipe, 0x3601, 0x06);
    ret += imx390_write_register(vi_pipe, 0x3604, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3605, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3608, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3609, 0x00);
    ret += imx390_write_register(vi_pipe, 0x360C, 0x01);
    ret += imx390_write_register(vi_pipe, 0x360D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3610, 0x10);
    ret += imx390_write_register(vi_pipe, 0x3611, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3612, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3613, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3614, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3615, 0x00);
    ret += imx390_write_register(vi_pipe, 0x361C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x361D, 0x01);
    ret += imx390_write_register(vi_pipe, 0x361E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x361F, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3620, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3621, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3622, 0xB0);
    ret += imx390_write_register(vi_pipe, 0x3623, 0x04);
    ret += imx390_write_register(vi_pipe, 0x3624, 0xDC);
    ret += imx390_write_register(vi_pipe, 0x3625, 0x05);
    ret += imx390_write_register(vi_pipe, 0x3626, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3627, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3628, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3629, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x362A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x362B, 0x10);
    ret += imx390_write_register(vi_pipe, 0x362C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x362D, 0x01);
    ret += imx390_write_register(vi_pipe, 0x36C4, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x36C5, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x36C6, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x36C7, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x36C8, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x36C9, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x36CC, 0x00);
    ret += imx390_write_register(vi_pipe, 0x36CD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x36CE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x36CF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x36D0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x36D1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x36D4, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x36D5, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x36D6, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x36D7, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x36D8, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x36D9, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x36DC, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x36DD, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x36DE, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x36DF, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x36E0, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x36E1, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x36E4, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x36E5, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x36E6, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x36E7, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x36E8, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x36E9, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x36EE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x36EF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x36F0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x36F1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x36F8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3700, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3701, 0x05);
    ret += imx390_write_register(vi_pipe, 0x3702, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3703, 0x04);
    ret += imx390_write_register(vi_pipe, 0x3704, 0x08);
    ret += imx390_write_register(vi_pipe, 0x3705, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3706, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3707, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3708, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3709, 0x03);
    ret += imx390_write_register(vi_pipe, 0x370A, 0x03);
    ret += imx390_write_register(vi_pipe, 0x370B, 0x03);
    ret += imx390_write_register(vi_pipe, 0x370C, 0x03);
    ret += imx390_write_register(vi_pipe, 0x370D, 0x03);
    ret += imx390_write_register(vi_pipe, 0x370E, 0x0E);
    ret += imx390_write_register(vi_pipe, 0x3718, 0x62);
    ret += imx390_write_register(vi_pipe, 0x3719, 0x4A);
    ret += imx390_write_register(vi_pipe, 0x371A, 0x38);
    ret += imx390_write_register(vi_pipe, 0x371B, 0x20);
    ret += imx390_write_register(vi_pipe, 0x371C, 0x64);
    ret += imx390_write_register(vi_pipe, 0x371D, 0x42);
    ret += imx390_write_register(vi_pipe, 0x371E, 0x32);
    ret += imx390_write_register(vi_pipe, 0x371F, 0x1B);
    ret += imx390_write_register(vi_pipe, 0x3720, 0x98);
    ret += imx390_write_register(vi_pipe, 0x3721, 0xA0);
    ret += imx390_write_register(vi_pipe, 0x3722, 0xA8);
    ret += imx390_write_register(vi_pipe, 0x3723, 0xB0);
    ret += imx390_write_register(vi_pipe, 0x3748, 0xA5);
    ret += imx390_write_register(vi_pipe, 0x3749, 0x9B);
    ret += imx390_write_register(vi_pipe, 0x374A, 0x91);
    ret += imx390_write_register(vi_pipe, 0x374B, 0x7D);
    ret += imx390_write_register(vi_pipe, 0x37C0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37C1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37C2, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37C4, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37C5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37C6, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37C8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37C9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37CA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37CC, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37CD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37CE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37D0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37D1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37D2, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37D4, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37D5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37D6, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37D8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37D9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37DA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37DC, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37DD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37DE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37E0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37E1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37E2, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37E4, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37E5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37E6, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37E8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37E9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37EA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37EC, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37ED, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37EE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37F0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37F4, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37F5, 0x1E);
    ret += imx390_write_register(vi_pipe, 0x37F6, 0x34);
    ret += imx390_write_register(vi_pipe, 0x37F7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37F8, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x37F9, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x37FA, 0x03);
    ret += imx390_write_register(vi_pipe, 0x37FC, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37FD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x37FE, 0x04);
    ret += imx390_write_register(vi_pipe, 0x3800, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3801, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3802, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3804, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3805, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3806, 0x04);
    ret += imx390_write_register(vi_pipe, 0x3808, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3809, 0x00);
    ret += imx390_write_register(vi_pipe, 0x380A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x380C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x380D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x380E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3810, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3811, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3812, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3814, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3815, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3816, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3818, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3819, 0x00);
    ret += imx390_write_register(vi_pipe, 0x381A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x381C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x381D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x381E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3820, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3821, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3822, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3824, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3825, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3826, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3828, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3829, 0x00);
    ret += imx390_write_register(vi_pipe, 0x382A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x382C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x382D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x382E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3830, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3831, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3832, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3834, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3835, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3836, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3838, 0xE7);
    ret += imx390_write_register(vi_pipe, 0x3839, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x383A, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x383B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x383C, 0xFD);
    ret += imx390_write_register(vi_pipe, 0x383D, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x383E, 0xF7);
    ret += imx390_write_register(vi_pipe, 0x383F, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3840, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3841, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3842, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3843, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3844, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3845, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3846, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3847, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3848, 0xB6);
    ret += imx390_write_register(vi_pipe, 0x3849, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x384A, 0xB6);
    ret += imx390_write_register(vi_pipe, 0x384B, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x384C, 0xB3);
    ret += imx390_write_register(vi_pipe, 0x384D, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x384E, 0xAF);
    ret += imx390_write_register(vi_pipe, 0x384F, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3850, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3851, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x3852, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3853, 0x10);
    ret += imx390_write_register(vi_pipe, 0x3854, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3855, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x3856, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3857, 0x10);
    ret += imx390_write_register(vi_pipe, 0x3858, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3859, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x385A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x385B, 0x10);
    ret += imx390_write_register(vi_pipe, 0x385C, 0x02);
    ret += imx390_write_register(vi_pipe, 0x385D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x385E, 0x06);
    ret += imx390_write_register(vi_pipe, 0x385F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3860, 0x06);
    ret += imx390_write_register(vi_pipe, 0x3861, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3862, 0x08);
    ret += imx390_write_register(vi_pipe, 0x3863, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3864, 0x02);
    ret += imx390_write_register(vi_pipe, 0x3865, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3870, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3871, 0x01);
    ret += imx390_write_register(vi_pipe, 0x38A0, 0x01);
    ret += imx390_write_register(vi_pipe, 0x38A1, 0x01);
    ret += imx390_write_register(vi_pipe, 0x38A2, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38A3, 0x01);
    ret += imx390_write_register(vi_pipe, 0x38A4, 0x07);
    ret += imx390_write_register(vi_pipe, 0x38A5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38A6, 0x04);
    ret += imx390_write_register(vi_pipe, 0x38A7, 0x04);
    ret += imx390_write_register(vi_pipe, 0x38A8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38A9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38AC, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38AD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38AE, 0x01);
    ret += imx390_write_register(vi_pipe, 0x38B0, 0x02);
    ret += imx390_write_register(vi_pipe, 0x38B2, 0x06);
    ret += imx390_write_register(vi_pipe, 0x38B3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38B4, 0x02);
    ret += imx390_write_register(vi_pipe, 0x38B5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38B6, 0x01);
    ret += imx390_write_register(vi_pipe, 0x38B7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38B8, 0x01);
    ret += imx390_write_register(vi_pipe, 0x38B9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38BA, 0x20);
    ret += imx390_write_register(vi_pipe, 0x38BB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38BC, 0x14);
    ret += imx390_write_register(vi_pipe, 0x38BD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38BE, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x38BF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38C0, 0x09);
    ret += imx390_write_register(vi_pipe, 0x38C1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38C2, 0x27);
    ret += imx390_write_register(vi_pipe, 0x38C3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38C4, 0x20);
    ret += imx390_write_register(vi_pipe, 0x38C5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38C6, 0x13);
    ret += imx390_write_register(vi_pipe, 0x38C7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38C8, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x38C9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38CA, 0x35);
    ret += imx390_write_register(vi_pipe, 0x38CB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38CC, 0x25);
    ret += imx390_write_register(vi_pipe, 0x38CD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38CE, 0x1B);
    ret += imx390_write_register(vi_pipe, 0x38CF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38D0, 0x11);
    ret += imx390_write_register(vi_pipe, 0x38D1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38D2, 0x4E);
    ret += imx390_write_register(vi_pipe, 0x38D3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38D4, 0x31);
    ret += imx390_write_register(vi_pipe, 0x38D5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38D6, 0x25);
    ret += imx390_write_register(vi_pipe, 0x38D7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38D8, 0x18);
    ret += imx390_write_register(vi_pipe, 0x38D9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38DA, 0x6E);
    ret += imx390_write_register(vi_pipe, 0x38DB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38DC, 0x46);
    ret += imx390_write_register(vi_pipe, 0x38DD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38DE, 0x32);
    ret += imx390_write_register(vi_pipe, 0x38DF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38E0, 0x22);
    ret += imx390_write_register(vi_pipe, 0x38E1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38E2, 0x93);
    ret += imx390_write_register(vi_pipe, 0x38E3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38E4, 0x5F);
    ret += imx390_write_register(vi_pipe, 0x38E5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38E6, 0x44);
    ret += imx390_write_register(vi_pipe, 0x38E7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38E8, 0x31);
    ret += imx390_write_register(vi_pipe, 0x38E9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38EA, 0xD8);
    ret += imx390_write_register(vi_pipe, 0x38EB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38EC, 0x8D);
    ret += imx390_write_register(vi_pipe, 0x38ED, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38EE, 0x6A);
    ret += imx390_write_register(vi_pipe, 0x38EF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38F0, 0x49);
    ret += imx390_write_register(vi_pipe, 0x38F1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38F2, 0x22);
    ret += imx390_write_register(vi_pipe, 0x38F3, 0x01);
    ret += imx390_write_register(vi_pipe, 0x38F4, 0xC8);
    ret += imx390_write_register(vi_pipe, 0x38F5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38F6, 0x8E);
    ret += imx390_write_register(vi_pipe, 0x38F7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38F8, 0x60);
    ret += imx390_write_register(vi_pipe, 0x38F9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38FA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38FB, 0x01);
    ret += imx390_write_register(vi_pipe, 0x38FC, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38FD, 0x01);
    ret += imx390_write_register(vi_pipe, 0x38FE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x38FF, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3900, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3901, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3902, 0x60);
    ret += imx390_write_register(vi_pipe, 0x3903, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3904, 0x25);
    ret += imx390_write_register(vi_pipe, 0x3905, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3906, 0x18);
    ret += imx390_write_register(vi_pipe, 0x3907, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3908, 0x10);
    ret += imx390_write_register(vi_pipe, 0x3909, 0x00);
    ret += imx390_write_register(vi_pipe, 0x390A, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x390B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x390C, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x390D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x390E, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x390F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3910, 0x85);
    ret += imx390_write_register(vi_pipe, 0x3911, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3912, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3913, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3914, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x3915, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3916, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x3917, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3918, 0x85);
    ret += imx390_write_register(vi_pipe, 0x3919, 0x00);
    ret += imx390_write_register(vi_pipe, 0x391A, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x391B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x391C, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x391D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x391E, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x391F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3920, 0x85);
    ret += imx390_write_register(vi_pipe, 0x3921, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3922, 0x40);
    ret += imx390_write_register(vi_pipe, 0x3923, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3924, 0x40);
    ret += imx390_write_register(vi_pipe, 0x3925, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3926, 0x40);
    ret += imx390_write_register(vi_pipe, 0x3927, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3928, 0x40);
    ret += imx390_write_register(vi_pipe, 0x3929, 0x00);
    ret += imx390_write_register(vi_pipe, 0x392A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x392B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x392C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x392D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x392E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x392F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3930, 0x80);
    ret += imx390_write_register(vi_pipe, 0x3931, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3932, 0x4C);
    ret += imx390_write_register(vi_pipe, 0x3933, 0x4C);
    ret += imx390_write_register(vi_pipe, 0x3934, 0x4C);
    ret += imx390_write_register(vi_pipe, 0x3940, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3941, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3942, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3943, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3944, 0x07);
    ret += imx390_write_register(vi_pipe, 0x3945, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3946, 0x04);
    ret += imx390_write_register(vi_pipe, 0x3947, 0x04);
    ret += imx390_write_register(vi_pipe, 0x3948, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3949, 0x00);
    ret += imx390_write_register(vi_pipe, 0x394C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x394D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x394E, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3950, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3952, 0x05);
    ret += imx390_write_register(vi_pipe, 0x3953, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3954, 0x02);
    ret += imx390_write_register(vi_pipe, 0x3955, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3956, 0x02);
    ret += imx390_write_register(vi_pipe, 0x3957, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3958, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3959, 0x00);
    ret += imx390_write_register(vi_pipe, 0x395A, 0x12);
    ret += imx390_write_register(vi_pipe, 0x395B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x395C, 0x09);
    ret += imx390_write_register(vi_pipe, 0x395D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x395E, 0x07);
    ret += imx390_write_register(vi_pipe, 0x395F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3960, 0x04);
    ret += imx390_write_register(vi_pipe, 0x3961, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3962, 0x1A);
    ret += imx390_write_register(vi_pipe, 0x3963, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3964, 0x0E);
    ret += imx390_write_register(vi_pipe, 0x3965, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3966, 0x09);
    ret += imx390_write_register(vi_pipe, 0x3967, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3968, 0x06);
    ret += imx390_write_register(vi_pipe, 0x3969, 0x00);
    ret += imx390_write_register(vi_pipe, 0x396A, 0x21);
    ret += imx390_write_register(vi_pipe, 0x396B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x396C, 0x11);
    ret += imx390_write_register(vi_pipe, 0x396D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x396E, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x396F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3970, 0x08);
    ret += imx390_write_register(vi_pipe, 0x3971, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3972, 0x29);
    ret += imx390_write_register(vi_pipe, 0x3973, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3974, 0x18);
    ret += imx390_write_register(vi_pipe, 0x3975, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3976, 0x11);
    ret += imx390_write_register(vi_pipe, 0x3977, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3978, 0x0D);
    ret += imx390_write_register(vi_pipe, 0x3979, 0x00);
    ret += imx390_write_register(vi_pipe, 0x397A, 0x3A);
    ret += imx390_write_register(vi_pipe, 0x397B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x397C, 0x21);
    ret += imx390_write_register(vi_pipe, 0x397D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x397E, 0x19);
    ret += imx390_write_register(vi_pipe, 0x397F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3980, 0x12);
    ret += imx390_write_register(vi_pipe, 0x3981, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3982, 0x52);
    ret += imx390_write_register(vi_pipe, 0x3983, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3984, 0x2F);
    ret += imx390_write_register(vi_pipe, 0x3985, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3986, 0x24);
    ret += imx390_write_register(vi_pipe, 0x3987, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3988, 0x18);
    ret += imx390_write_register(vi_pipe, 0x3989, 0x00);
    ret += imx390_write_register(vi_pipe, 0x398A, 0x78);
    ret += imx390_write_register(vi_pipe, 0x398B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x398C, 0x44);
    ret += imx390_write_register(vi_pipe, 0x398D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x398E, 0x34);
    ret += imx390_write_register(vi_pipe, 0x398F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3990, 0x27);
    ret += imx390_write_register(vi_pipe, 0x3991, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3992, 0xA1);
    ret += imx390_write_register(vi_pipe, 0x3993, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3994, 0x61);
    ret += imx390_write_register(vi_pipe, 0x3995, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3996, 0x4E);
    ret += imx390_write_register(vi_pipe, 0x3997, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3998, 0x37);
    ret += imx390_write_register(vi_pipe, 0x3999, 0x00);
    ret += imx390_write_register(vi_pipe, 0x399A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x399B, 0x01);
    ret += imx390_write_register(vi_pipe, 0x399C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x399D, 0x01);
    ret += imx390_write_register(vi_pipe, 0x399E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x399F, 0x01);
    ret += imx390_write_register(vi_pipe, 0x39A0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39A1, 0x01);
    ret += imx390_write_register(vi_pipe, 0x39A2, 0x60);
    ret += imx390_write_register(vi_pipe, 0x39A3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39A4, 0x20);
    ret += imx390_write_register(vi_pipe, 0x39A5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39A6, 0x15);
    ret += imx390_write_register(vi_pipe, 0x39A7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39A8, 0x10);
    ret += imx390_write_register(vi_pipe, 0x39A9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39AA, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x39AB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39AC, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x39AD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39AE, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x39AF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39B0, 0x85);
    ret += imx390_write_register(vi_pipe, 0x39B1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39B2, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x39B3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39B4, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x39B5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39B6, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x39B7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39B8, 0x85);
    ret += imx390_write_register(vi_pipe, 0x39B9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39BA, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x39BB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39BC, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x39BD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39BE, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x39BF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39C0, 0x85);
    ret += imx390_write_register(vi_pipe, 0x39C1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39C2, 0x40);
    ret += imx390_write_register(vi_pipe, 0x39C3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39C4, 0x40);
    ret += imx390_write_register(vi_pipe, 0x39C5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39C6, 0x40);
    ret += imx390_write_register(vi_pipe, 0x39C7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39C8, 0x40);
    ret += imx390_write_register(vi_pipe, 0x39C9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39CA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x39CB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39CC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x39CD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39CE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x39CF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39D0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x39D1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39D2, 0x4C);
    ret += imx390_write_register(vi_pipe, 0x39D3, 0x4C);
    ret += imx390_write_register(vi_pipe, 0x39D4, 0x4C);
    ret += imx390_write_register(vi_pipe, 0x39E0, 0x01);
    ret += imx390_write_register(vi_pipe, 0x39E1, 0x01);
    ret += imx390_write_register(vi_pipe, 0x39E4, 0x40);
    ret += imx390_write_register(vi_pipe, 0x39E5, 0x01);
    ret += imx390_write_register(vi_pipe, 0x39E6, 0x01);
    ret += imx390_write_register(vi_pipe, 0x39E8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39E9, 0x01);
    ret += imx390_write_register(vi_pipe, 0x39EA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39EB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39EC, 0x01);
    ret += imx390_write_register(vi_pipe, 0x39ED, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39EE, 0x01);
    ret += imx390_write_register(vi_pipe, 0x39F0, 0x03);
    ret += imx390_write_register(vi_pipe, 0x39F1, 0x04);
    ret += imx390_write_register(vi_pipe, 0x39F2, 0x0E);
    ret += imx390_write_register(vi_pipe, 0x39F4, 0x0B);
    ret += imx390_write_register(vi_pipe, 0x39F5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39F6, 0x07);
    ret += imx390_write_register(vi_pipe, 0x39F7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39F8, 0x05);
    ret += imx390_write_register(vi_pipe, 0x39F9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39FA, 0x02);
    ret += imx390_write_register(vi_pipe, 0x39FB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39FC, 0x34);
    ret += imx390_write_register(vi_pipe, 0x39FD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x39FE, 0x1B);
    ret += imx390_write_register(vi_pipe, 0x39FF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A00, 0x13);
    ret += imx390_write_register(vi_pipe, 0x3A01, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A02, 0x09);
    ret += imx390_write_register(vi_pipe, 0x3A03, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A04, 0x4D);
    ret += imx390_write_register(vi_pipe, 0x3A05, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A06, 0x22);
    ret += imx390_write_register(vi_pipe, 0x3A07, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A08, 0x14);
    ret += imx390_write_register(vi_pipe, 0x3A09, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A0A, 0x09);
    ret += imx390_write_register(vi_pipe, 0x3A0B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A0C, 0x61);
    ret += imx390_write_register(vi_pipe, 0x3A0D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A0E, 0x22);
    ret += imx390_write_register(vi_pipe, 0x3A0F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A10, 0x15);
    ret += imx390_write_register(vi_pipe, 0x3A11, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A12, 0x0A);
    ret += imx390_write_register(vi_pipe, 0x3A13, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A14, 0x6D);
    ret += imx390_write_register(vi_pipe, 0x3A15, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A16, 0x24);
    ret += imx390_write_register(vi_pipe, 0x3A17, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A18, 0x16);
    ret += imx390_write_register(vi_pipe, 0x3A19, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A1A, 0x0B);
    ret += imx390_write_register(vi_pipe, 0x3A1B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A1C, 0x6F);
    ret += imx390_write_register(vi_pipe, 0x3A1D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A1E, 0x26);
    ret += imx390_write_register(vi_pipe, 0x3A1F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A20, 0x18);
    ret += imx390_write_register(vi_pipe, 0x3A21, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A22, 0x0E);
    ret += imx390_write_register(vi_pipe, 0x3A23, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A24, 0x72);
    ret += imx390_write_register(vi_pipe, 0x3A25, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A26, 0x2B);
    ret += imx390_write_register(vi_pipe, 0x3A27, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A28, 0x1E);
    ret += imx390_write_register(vi_pipe, 0x3A29, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A2A, 0x13);
    ret += imx390_write_register(vi_pipe, 0x3A2B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A2C, 0x7B);
    ret += imx390_write_register(vi_pipe, 0x3A2D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A2E, 0x37);
    ret += imx390_write_register(vi_pipe, 0x3A2F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A30, 0x29);
    ret += imx390_write_register(vi_pipe, 0x3A31, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A32, 0x1F);
    ret += imx390_write_register(vi_pipe, 0x3A33, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A34, 0x94);
    ret += imx390_write_register(vi_pipe, 0x3A35, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A36, 0x4E);
    ret += imx390_write_register(vi_pipe, 0x3A37, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A38, 0x42);
    ret += imx390_write_register(vi_pipe, 0x3A39, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A3A, 0x36);
    ret += imx390_write_register(vi_pipe, 0x3A3B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A3C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A3D, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3A3E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A3F, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3A40, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A41, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3A42, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A43, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3A44, 0x70);
    ret += imx390_write_register(vi_pipe, 0x3A45, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A46, 0x25);
    ret += imx390_write_register(vi_pipe, 0x3A47, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A48, 0x18);
    ret += imx390_write_register(vi_pipe, 0x3A49, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A4A, 0x10);
    ret += imx390_write_register(vi_pipe, 0x3A4B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A4C, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3A4D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A4E, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x3A4F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A50, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x3A51, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A52, 0x85);
    ret += imx390_write_register(vi_pipe, 0x3A53, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A54, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3A55, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A56, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x3A57, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A58, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x3A59, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A5A, 0x85);
    ret += imx390_write_register(vi_pipe, 0x3A5B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A5C, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3A5D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A5E, 0xD5);
    ret += imx390_write_register(vi_pipe, 0x3A5F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A60, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x3A61, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A62, 0x85);
    ret += imx390_write_register(vi_pipe, 0x3A63, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A64, 0x1C);
    ret += imx390_write_register(vi_pipe, 0x3A65, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A66, 0x13);
    ret += imx390_write_register(vi_pipe, 0x3A67, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A68, 0x0D);
    ret += imx390_write_register(vi_pipe, 0x3A69, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A6A, 0x07);
    ret += imx390_write_register(vi_pipe, 0x3A6B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A6C, 0x0D);
    ret += imx390_write_register(vi_pipe, 0x3A6D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A6E, 0x0B);
    ret += imx390_write_register(vi_pipe, 0x3A6F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A70, 0x06);
    ret += imx390_write_register(vi_pipe, 0x3A71, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A72, 0x05);
    ret += imx390_write_register(vi_pipe, 0x3A73, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A74, 0x19);
    ret += imx390_write_register(vi_pipe, 0x3A75, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A76, 0x14);
    ret += imx390_write_register(vi_pipe, 0x3A77, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A78, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x3A79, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A7A, 0x0A);
    ret += imx390_write_register(vi_pipe, 0x3A7B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A7C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x3A7D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A7E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x3A7F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A80, 0x80);
    ret += imx390_write_register(vi_pipe, 0x3A81, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A82, 0x80);
    ret += imx390_write_register(vi_pipe, 0x3A83, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A84, 0x08);
    ret += imx390_write_register(vi_pipe, 0x3A85, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A86, 0x05);
    ret += imx390_write_register(vi_pipe, 0x3A87, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A88, 0x04);
    ret += imx390_write_register(vi_pipe, 0x3A89, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A8A, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3A8B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A8C, 0xCD);
    ret += imx390_write_register(vi_pipe, 0x3A8D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A8E, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x3A8F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A90, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x3A91, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A92, 0x64);
    ret += imx390_write_register(vi_pipe, 0x3A93, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A94, 0xCD);
    ret += imx390_write_register(vi_pipe, 0x3A95, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A96, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x3A97, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A98, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x3A99, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A9A, 0x64);
    ret += imx390_write_register(vi_pipe, 0x3A9B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3A9C, 0x08);
    ret += imx390_write_register(vi_pipe, 0x3A9D, 0x10);
    ret += imx390_write_register(vi_pipe, 0x3A9E, 0x4C);
    ret += imx390_write_register(vi_pipe, 0x3A9F, 0x4C);
    ret += imx390_write_register(vi_pipe, 0x3AA0, 0x4C);
    ret += imx390_write_register(vi_pipe, 0x3AA1, 0x04);
    ret += imx390_write_register(vi_pipe, 0x3AA2, 0x04);
    ret += imx390_write_register(vi_pipe, 0x3AC0, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3AC4, 0x81);
    ret += imx390_write_register(vi_pipe, 0x3AC5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AC6, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AC7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AC8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AC9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3ACA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3ACB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3ACC, 0x02);
    ret += imx390_write_register(vi_pipe, 0x3ACD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3ACE, 0x81);
    ret += imx390_write_register(vi_pipe, 0x3ACF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AD0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AD1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AD2, 0xFD);
    ret += imx390_write_register(vi_pipe, 0x3AD3, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3AD4, 0x02);
    ret += imx390_write_register(vi_pipe, 0x3AD5, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AD6, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AD7, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AD8, 0x81);
    ret += imx390_write_register(vi_pipe, 0x3AD9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3ADA, 0xFD);
    ret += imx390_write_register(vi_pipe, 0x3ADB, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3ADC, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x3ADD, 0x03);
    ret += imx390_write_register(vi_pipe, 0x3ADE, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3ADF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AE0, 0x01);
    ret += imx390_write_register(vi_pipe, 0x3AE1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AE2, 0x7E);
    ret += imx390_write_register(vi_pipe, 0x3AE3, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AF4, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AF6, 0x40);
    ret += imx390_write_register(vi_pipe, 0x3AF7, 0x1E);
    ret += imx390_write_register(vi_pipe, 0x3AF8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AFA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AFB, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AFC, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AFD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AFE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3AFF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B00, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B01, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B02, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B03, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B04, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B05, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B06, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B07, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B08, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B09, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B0A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B0B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B0C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B0D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B0E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B0F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B10, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B11, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B12, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B13, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B14, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B15, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B16, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B17, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B18, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B19, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B1A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B1B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B1C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B1D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B1E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B1F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B20, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B21, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B22, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B23, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B24, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B25, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B26, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B27, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B28, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B29, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B2A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B2C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B2E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B30, 0x00);
    ret += imx390_write_register(vi_pipe, 0x3B32, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x4000, 0xD0);
    ret += imx390_write_register(vi_pipe, 0x4001, 0xC8);
    ret += imx390_write_register(vi_pipe, 0x4002, 0xC8);
    ret += imx390_write_register(vi_pipe, 0x4003, 0xC6);
    ret += imx390_write_register(vi_pipe, 0x4004, 0xBA);
    ret += imx390_write_register(vi_pipe, 0x4005, 0xB5);
    ret += imx390_write_register(vi_pipe, 0x4006, 0xB5);
    ret += imx390_write_register(vi_pipe, 0x4007, 0xB4);
    ret += imx390_write_register(vi_pipe, 0x4008, 0xAA);
    ret += imx390_write_register(vi_pipe, 0x4009, 0xA7);
    ret += imx390_write_register(vi_pipe, 0x400A, 0xA7);
    ret += imx390_write_register(vi_pipe, 0x400B, 0xA7);
    ret += imx390_write_register(vi_pipe, 0x400C, 0xA1);
    ret += imx390_write_register(vi_pipe, 0x400D, 0x9F);
    ret += imx390_write_register(vi_pipe, 0x400E, 0x9F);
    ret += imx390_write_register(vi_pipe, 0x400F, 0x9F);
    ret += imx390_write_register(vi_pipe, 0x4010, 0x9C);
    ret += imx390_write_register(vi_pipe, 0x4011, 0x9B);
    ret += imx390_write_register(vi_pipe, 0x4012, 0x9B);
    ret += imx390_write_register(vi_pipe, 0x4013, 0x9B);
    ret += imx390_write_register(vi_pipe, 0x4014, 0x9F);
    ret += imx390_write_register(vi_pipe, 0x4015, 0x9E);
    ret += imx390_write_register(vi_pipe, 0x4016, 0x9D);
    ret += imx390_write_register(vi_pipe, 0x4017, 0x9E);
    ret += imx390_write_register(vi_pipe, 0x4018, 0xA7);
    ret += imx390_write_register(vi_pipe, 0x4019, 0xA4);
    ret += imx390_write_register(vi_pipe, 0x401A, 0xA4);
    ret += imx390_write_register(vi_pipe, 0x401B, 0xA4);
    ret += imx390_write_register(vi_pipe, 0x401C, 0xB5);
    ret += imx390_write_register(vi_pipe, 0x401D, 0xB0);
    ret += imx390_write_register(vi_pipe, 0x401E, 0xB0);
    ret += imx390_write_register(vi_pipe, 0x401F, 0xB0);
    ret += imx390_write_register(vi_pipe, 0x4020, 0xC9);
    ret += imx390_write_register(vi_pipe, 0x4021, 0xC1);
    ret += imx390_write_register(vi_pipe, 0x4022, 0xC1);
    ret += imx390_write_register(vi_pipe, 0x4023, 0xC0);
    ret += imx390_write_register(vi_pipe, 0x4024, 0xC3);
    ret += imx390_write_register(vi_pipe, 0x4025, 0xBB);
    ret += imx390_write_register(vi_pipe, 0x4026, 0xBC);
    ret += imx390_write_register(vi_pipe, 0x4027, 0xBA);
    ret += imx390_write_register(vi_pipe, 0x4028, 0xA5);
    ret += imx390_write_register(vi_pipe, 0x4029, 0xA1);
    ret += imx390_write_register(vi_pipe, 0x402A, 0xA1);
    ret += imx390_write_register(vi_pipe, 0x402B, 0xA0);
    ret += imx390_write_register(vi_pipe, 0x402C, 0x99);
    ret += imx390_write_register(vi_pipe, 0x402D, 0x97);
    ret += imx390_write_register(vi_pipe, 0x402E, 0x97);
    ret += imx390_write_register(vi_pipe, 0x402F, 0x96);
    ret += imx390_write_register(vi_pipe, 0x4030, 0x8F);
    ret += imx390_write_register(vi_pipe, 0x4031, 0x8E);
    ret += imx390_write_register(vi_pipe, 0x4032, 0x8E);
    ret += imx390_write_register(vi_pipe, 0x4033, 0x8E);
    ret += imx390_write_register(vi_pipe, 0x4034, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x4035, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x4036, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x4037, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x4038, 0x8D);
    ret += imx390_write_register(vi_pipe, 0x4039, 0x8D);
    ret += imx390_write_register(vi_pipe, 0x403A, 0x8D);
    ret += imx390_write_register(vi_pipe, 0x403B, 0x8D);
    ret += imx390_write_register(vi_pipe, 0x403C, 0x96);
    ret += imx390_write_register(vi_pipe, 0x403D, 0x94);
    ret += imx390_write_register(vi_pipe, 0x403E, 0x94);
    ret += imx390_write_register(vi_pipe, 0x403F, 0x94);
    ret += imx390_write_register(vi_pipe, 0x4040, 0xA2);
    ret += imx390_write_register(vi_pipe, 0x4041, 0x9E);
    ret += imx390_write_register(vi_pipe, 0x4042, 0x9E);
    ret += imx390_write_register(vi_pipe, 0x4043, 0x9D);
    ret += imx390_write_register(vi_pipe, 0x4044, 0xBC);
    ret += imx390_write_register(vi_pipe, 0x4045, 0xB5);
    ret += imx390_write_register(vi_pipe, 0x4046, 0xB5);
    ret += imx390_write_register(vi_pipe, 0x4047, 0xB4);
    ret += imx390_write_register(vi_pipe, 0x4048, 0xBC);
    ret += imx390_write_register(vi_pipe, 0x4049, 0xB5);
    ret += imx390_write_register(vi_pipe, 0x404A, 0xB5);
    ret += imx390_write_register(vi_pipe, 0x404B, 0xB3);
    ret += imx390_write_register(vi_pipe, 0x404C, 0xA3);
    ret += imx390_write_register(vi_pipe, 0x404D, 0x9F);
    ret += imx390_write_register(vi_pipe, 0x404E, 0x9F);
    ret += imx390_write_register(vi_pipe, 0x404F, 0x9E);
    ret += imx390_write_register(vi_pipe, 0x4050, 0x95);
    ret += imx390_write_register(vi_pipe, 0x4051, 0x93);
    ret += imx390_write_register(vi_pipe, 0x4052, 0x93);
    ret += imx390_write_register(vi_pipe, 0x4053, 0x93);
    ret += imx390_write_register(vi_pipe, 0x4054, 0x89);
    ret += imx390_write_register(vi_pipe, 0x4055, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4056, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4057, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4058, 0x81);
    ret += imx390_write_register(vi_pipe, 0x4059, 0x81);
    ret += imx390_write_register(vi_pipe, 0x405A, 0x81);
    ret += imx390_write_register(vi_pipe, 0x405B, 0x81);
    ret += imx390_write_register(vi_pipe, 0x405C, 0x86);
    ret += imx390_write_register(vi_pipe, 0x405D, 0x86);
    ret += imx390_write_register(vi_pipe, 0x405E, 0x86);
    ret += imx390_write_register(vi_pipe, 0x405F, 0x86);
    ret += imx390_write_register(vi_pipe, 0x4060, 0x92);
    ret += imx390_write_register(vi_pipe, 0x4061, 0x90);
    ret += imx390_write_register(vi_pipe, 0x4062, 0x90);
    ret += imx390_write_register(vi_pipe, 0x4063, 0x90);
    ret += imx390_write_register(vi_pipe, 0x4064, 0x9E);
    ret += imx390_write_register(vi_pipe, 0x4065, 0x9B);
    ret += imx390_write_register(vi_pipe, 0x4066, 0x9B);
    ret += imx390_write_register(vi_pipe, 0x4067, 0x9A);
    ret += imx390_write_register(vi_pipe, 0x4068, 0xB5);
    ret += imx390_write_register(vi_pipe, 0x4069, 0xAE);
    ret += imx390_write_register(vi_pipe, 0x406A, 0xAE);
    ret += imx390_write_register(vi_pipe, 0x406B, 0xAE);
    ret += imx390_write_register(vi_pipe, 0x406C, 0xBE);
    ret += imx390_write_register(vi_pipe, 0x406D, 0xB6);
    ret += imx390_write_register(vi_pipe, 0x406E, 0xB7);
    ret += imx390_write_register(vi_pipe, 0x406F, 0xB5);
    ret += imx390_write_register(vi_pipe, 0x4070, 0xA4);
    ret += imx390_write_register(vi_pipe, 0x4071, 0xA0);
    ret += imx390_write_register(vi_pipe, 0x4072, 0xA0);
    ret += imx390_write_register(vi_pipe, 0x4073, 0x9F);
    ret += imx390_write_register(vi_pipe, 0x4074, 0x96);
    ret += imx390_write_register(vi_pipe, 0x4075, 0x94);
    ret += imx390_write_register(vi_pipe, 0x4076, 0x94);
    ret += imx390_write_register(vi_pipe, 0x4077, 0x94);
    ret += imx390_write_register(vi_pipe, 0x4078, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x4079, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x407A, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x407B, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x407C, 0x83);
    ret += imx390_write_register(vi_pipe, 0x407D, 0x83);
    ret += imx390_write_register(vi_pipe, 0x407E, 0x83);
    ret += imx390_write_register(vi_pipe, 0x407F, 0x83);
    ret += imx390_write_register(vi_pipe, 0x4080, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4081, 0x87);
    ret += imx390_write_register(vi_pipe, 0x4082, 0x87);
    ret += imx390_write_register(vi_pipe, 0x4083, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4084, 0x93);
    ret += imx390_write_register(vi_pipe, 0x4085, 0x91);
    ret += imx390_write_register(vi_pipe, 0x4086, 0x91);
    ret += imx390_write_register(vi_pipe, 0x4087, 0x91);
    ret += imx390_write_register(vi_pipe, 0x4088, 0xA0);
    ret += imx390_write_register(vi_pipe, 0x4089, 0x9C);
    ret += imx390_write_register(vi_pipe, 0x408A, 0x9C);
    ret += imx390_write_register(vi_pipe, 0x408B, 0x9C);
    ret += imx390_write_register(vi_pipe, 0x408C, 0xB6);
    ret += imx390_write_register(vi_pipe, 0x408D, 0xAF);
    ret += imx390_write_register(vi_pipe, 0x408E, 0xAF);
    ret += imx390_write_register(vi_pipe, 0x408F, 0xAF);
    ret += imx390_write_register(vi_pipe, 0x4090, 0xCA);
    ret += imx390_write_register(vi_pipe, 0x4091, 0xC1);
    ret += imx390_write_register(vi_pipe, 0x4092, 0xC1);
    ret += imx390_write_register(vi_pipe, 0x4093, 0xBF);
    ret += imx390_write_register(vi_pipe, 0x4094, 0xAB);
    ret += imx390_write_register(vi_pipe, 0x4095, 0xA5);
    ret += imx390_write_register(vi_pipe, 0x4096, 0xA5);
    ret += imx390_write_register(vi_pipe, 0x4097, 0xA4);
    ret += imx390_write_register(vi_pipe, 0x4098, 0x9E);
    ret += imx390_write_register(vi_pipe, 0x4099, 0x9A);
    ret += imx390_write_register(vi_pipe, 0x409A, 0x9A);
    ret += imx390_write_register(vi_pipe, 0x409B, 0x9A);
    ret += imx390_write_register(vi_pipe, 0x409C, 0x94);
    ret += imx390_write_register(vi_pipe, 0x409D, 0x92);
    ret += imx390_write_register(vi_pipe, 0x409E, 0x92);
    ret += imx390_write_register(vi_pipe, 0x409F, 0x92);
    ret += imx390_write_register(vi_pipe, 0x40A0, 0x8F);
    ret += imx390_write_register(vi_pipe, 0x40A1, 0x8E);
    ret += imx390_write_register(vi_pipe, 0x40A2, 0x8E);
    ret += imx390_write_register(vi_pipe, 0x40A3, 0x8E);
    ret += imx390_write_register(vi_pipe, 0x40A4, 0x92);
    ret += imx390_write_register(vi_pipe, 0x40A5, 0x90);
    ret += imx390_write_register(vi_pipe, 0x40A6, 0x90);
    ret += imx390_write_register(vi_pipe, 0x40A7, 0x90);
    ret += imx390_write_register(vi_pipe, 0x40A8, 0x9A);
    ret += imx390_write_register(vi_pipe, 0x40A9, 0x97);
    ret += imx390_write_register(vi_pipe, 0x40AA, 0x97);
    ret += imx390_write_register(vi_pipe, 0x40AB, 0x97);
    ret += imx390_write_register(vi_pipe, 0x40AC, 0xA6);
    ret += imx390_write_register(vi_pipe, 0x40AD, 0xA0);
    ret += imx390_write_register(vi_pipe, 0x40AE, 0xA0);
    ret += imx390_write_register(vi_pipe, 0x40AF, 0xA0);
    ret += imx390_write_register(vi_pipe, 0x40B0, 0xC1);
    ret += imx390_write_register(vi_pipe, 0x40B1, 0xB9);
    ret += imx390_write_register(vi_pipe, 0x40B2, 0xB9);
    ret += imx390_write_register(vi_pipe, 0x40B3, 0xB8);
    ret += imx390_write_register(vi_pipe, 0x40B4, 0xDD);
    ret += imx390_write_register(vi_pipe, 0x40B5, 0xD2);
    ret += imx390_write_register(vi_pipe, 0x40B6, 0xD2);
    ret += imx390_write_register(vi_pipe, 0x40B7, 0xCF);
    ret += imx390_write_register(vi_pipe, 0x40B8, 0xC6);
    ret += imx390_write_register(vi_pipe, 0x40B9, 0xBF);
    ret += imx390_write_register(vi_pipe, 0x40BA, 0xBF);
    ret += imx390_write_register(vi_pipe, 0x40BB, 0xBD);
    ret += imx390_write_register(vi_pipe, 0x40BC, 0xB5);
    ret += imx390_write_register(vi_pipe, 0x40BD, 0xB0);
    ret += imx390_write_register(vi_pipe, 0x40BE, 0xB0);
    ret += imx390_write_register(vi_pipe, 0x40BF, 0xAF);
    ret += imx390_write_register(vi_pipe, 0x40C0, 0xAB);
    ret += imx390_write_register(vi_pipe, 0x40C1, 0xA8);
    ret += imx390_write_register(vi_pipe, 0x40C2, 0xA8);
    ret += imx390_write_register(vi_pipe, 0x40C3, 0xA7);
    ret += imx390_write_register(vi_pipe, 0x40C4, 0xA7);
    ret += imx390_write_register(vi_pipe, 0x40C5, 0xA3);
    ret += imx390_write_register(vi_pipe, 0x40C6, 0xA3);
    ret += imx390_write_register(vi_pipe, 0x40C7, 0xA3);
    ret += imx390_write_register(vi_pipe, 0x40C8, 0xA9);
    ret += imx390_write_register(vi_pipe, 0x40C9, 0xA6);
    ret += imx390_write_register(vi_pipe, 0x40CA, 0xA6);
    ret += imx390_write_register(vi_pipe, 0x40CB, 0xA6);
    ret += imx390_write_register(vi_pipe, 0x40CC, 0xB0);
    ret += imx390_write_register(vi_pipe, 0x40CD, 0xAB);
    ret += imx390_write_register(vi_pipe, 0x40CE, 0xAB);
    ret += imx390_write_register(vi_pipe, 0x40CF, 0xAB);
    ret += imx390_write_register(vi_pipe, 0x40D0, 0xBF);
    ret += imx390_write_register(vi_pipe, 0x40D1, 0xB7);
    ret += imx390_write_register(vi_pipe, 0x40D2, 0xB7);
    ret += imx390_write_register(vi_pipe, 0x40D3, 0xB7);
    ret += imx390_write_register(vi_pipe, 0x40D4, 0xD2);
    ret += imx390_write_register(vi_pipe, 0x40D5, 0xC8);
    ret += imx390_write_register(vi_pipe, 0x40D6, 0xC7);
    ret += imx390_write_register(vi_pipe, 0x40D7, 0xC7);
    ret += imx390_write_register(vi_pipe, 0x4100, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4101, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4102, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4103, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4104, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4105, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4106, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4107, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4108, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4109, 0x80);
    ret += imx390_write_register(vi_pipe, 0x410A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x410B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x410C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x410D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x410E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x410F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4110, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4111, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4112, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4113, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4114, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4115, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4116, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4117, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4118, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4119, 0x80);
    ret += imx390_write_register(vi_pipe, 0x411A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x411B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x411C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x411D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x411E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x411F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4120, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4121, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4122, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4123, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4124, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4125, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4126, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4127, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4128, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4129, 0x80);
    ret += imx390_write_register(vi_pipe, 0x412A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x412B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x412C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x412D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x412E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x412F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4130, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4131, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4132, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4133, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4134, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4135, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4136, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4137, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4138, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4139, 0x80);
    ret += imx390_write_register(vi_pipe, 0x413A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x413B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x413C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x413D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x413E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x413F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4140, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4141, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4142, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4143, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4144, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4145, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4146, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4147, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4148, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4149, 0x80);
    ret += imx390_write_register(vi_pipe, 0x414A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x414B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x414C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x414D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x414E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x414F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4150, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4151, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4152, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4153, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4154, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4155, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4156, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4157, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4158, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4159, 0x80);
    ret += imx390_write_register(vi_pipe, 0x415A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x415B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x415C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x415D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x415E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x415F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4160, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4161, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4162, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4163, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4164, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4165, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4166, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4167, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4168, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4169, 0x80);
    ret += imx390_write_register(vi_pipe, 0x416A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x416B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x416C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x416D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x416E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x416F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4170, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4171, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4172, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4173, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4174, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4175, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4176, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4177, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4178, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4179, 0x80);
    ret += imx390_write_register(vi_pipe, 0x417A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x417B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x417C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x417D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x417E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x417F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4180, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4181, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4182, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4183, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4184, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4185, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4186, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4187, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4188, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4189, 0x80);
    ret += imx390_write_register(vi_pipe, 0x418A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x418B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x418C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x418D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x418E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x418F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4190, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4191, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4192, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4193, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4194, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4195, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4196, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4197, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4198, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4199, 0x80);
    ret += imx390_write_register(vi_pipe, 0x419A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x419B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x419C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x419D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x419E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x419F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41A0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41A1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41A2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41A3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41A4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41A5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41A6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41A7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41A8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41A9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41AA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41AB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41AC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41AD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41AE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41AF, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41B0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41B1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41B2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41B3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41B4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41B5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41B6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41B7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41B8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41B9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41BA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41BB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41BC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41BD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41BE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41BF, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41C0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41C1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41C2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41C3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41C4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41C5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41C6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41C7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41C8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41C9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41CA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41CB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41CC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41CD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41CE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41CF, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41D0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41D1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41D2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41D3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41D4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41D5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41D6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x41D7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4200, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4201, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4202, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4203, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4204, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4205, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4206, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4207, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4208, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4209, 0x80);
    ret += imx390_write_register(vi_pipe, 0x420A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x420B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x420C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x420D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x420E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x420F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4210, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4211, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4212, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4213, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4214, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4215, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4216, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4217, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4218, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4219, 0x80);
    ret += imx390_write_register(vi_pipe, 0x421A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x421B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x421C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x421D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x421E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x421F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4220, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4221, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4222, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4223, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4224, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4225, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4226, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4227, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4228, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4229, 0x80);
    ret += imx390_write_register(vi_pipe, 0x422A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x422B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x422C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x422D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x422E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x422F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4230, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4231, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4232, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4233, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4234, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4235, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4236, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4237, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4238, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4239, 0x80);
    ret += imx390_write_register(vi_pipe, 0x423A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x423B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x423C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x423D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x423E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x423F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4240, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4241, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4242, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4243, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4244, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4245, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4246, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4247, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4248, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4249, 0x80);
    ret += imx390_write_register(vi_pipe, 0x424A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x424B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x424C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x424D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x424E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x424F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4250, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4251, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4252, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4253, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4254, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4255, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4256, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4257, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4258, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4259, 0x80);
    ret += imx390_write_register(vi_pipe, 0x425A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x425B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x425C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x425D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x425E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x425F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4260, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4261, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4262, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4263, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4264, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4265, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4266, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4267, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4268, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4269, 0x80);
    ret += imx390_write_register(vi_pipe, 0x426A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x426B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x426C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x426D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x426E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x426F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4270, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4271, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4272, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4273, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4274, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4275, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4276, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4277, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4278, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4279, 0x80);
    ret += imx390_write_register(vi_pipe, 0x427A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x427B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x427C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x427D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x427E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x427F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4280, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4281, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4282, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4283, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4284, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4285, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4286, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4287, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4288, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4289, 0x80);
    ret += imx390_write_register(vi_pipe, 0x428A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x428B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x428C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x428D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x428E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x428F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4290, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4291, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4292, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4293, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4294, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4295, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4296, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4297, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4298, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4299, 0x80);
    ret += imx390_write_register(vi_pipe, 0x429A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x429B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x429C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x429D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x429E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x429F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42A0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42A1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42A2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42A3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42A4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42A5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42A6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42A7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42A8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42A9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42AA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42AB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42AC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42AD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42AE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42AF, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42B0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42B1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42B2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42B3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42B4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42B5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42B6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42B7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42B8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42B9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42BA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42BB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42BC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42BD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42BE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42BF, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42C0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42C1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42C2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42C3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42C4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42C5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42C6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42C7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42C8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42C9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42CA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42CB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42CC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42CD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42CE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42CF, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42D0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42D1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42D2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42D3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42D4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42D5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42D6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42D7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x42D8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x42D9, 0x00);
    ret += imx390_write_register(vi_pipe, 0x4300, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x4301, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4302, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4303, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x4304, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4305, 0x84);
    ret += imx390_write_register(vi_pipe, 0x4306, 0x84);
    ret += imx390_write_register(vi_pipe, 0x4307, 0x86);
    ret += imx390_write_register(vi_pipe, 0x4308, 0x84);
    ret += imx390_write_register(vi_pipe, 0x4309, 0x82);
    ret += imx390_write_register(vi_pipe, 0x430A, 0x82);
    ret += imx390_write_register(vi_pipe, 0x430B, 0x82);
    ret += imx390_write_register(vi_pipe, 0x430C, 0x81);
    ret += imx390_write_register(vi_pipe, 0x430D, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x430E, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x430F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4310, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x4311, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x4312, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x4313, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4314, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4315, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4316, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x4317, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4318, 0x83);
    ret += imx390_write_register(vi_pipe, 0x4319, 0x82);
    ret += imx390_write_register(vi_pipe, 0x431A, 0x82);
    ret += imx390_write_register(vi_pipe, 0x431B, 0x82);
    ret += imx390_write_register(vi_pipe, 0x431C, 0x83);
    ret += imx390_write_register(vi_pipe, 0x431D, 0x83);
    ret += imx390_write_register(vi_pipe, 0x431E, 0x83);
    ret += imx390_write_register(vi_pipe, 0x431F, 0x83);
    ret += imx390_write_register(vi_pipe, 0x4320, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4321, 0x87);
    ret += imx390_write_register(vi_pipe, 0x4322, 0x86);
    ret += imx390_write_register(vi_pipe, 0x4323, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4324, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x4325, 0x86);
    ret += imx390_write_register(vi_pipe, 0x4326, 0x86);
    ret += imx390_write_register(vi_pipe, 0x4327, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4328, 0x85);
    ret += imx390_write_register(vi_pipe, 0x4329, 0x82);
    ret += imx390_write_register(vi_pipe, 0x432A, 0x82);
    ret += imx390_write_register(vi_pipe, 0x432B, 0x84);
    ret += imx390_write_register(vi_pipe, 0x432C, 0x81);
    ret += imx390_write_register(vi_pipe, 0x432D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x432E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x432F, 0x81);
    ret += imx390_write_register(vi_pipe, 0x4330, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4331, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x4332, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x4333, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4334, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x4335, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x4336, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x4337, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4338, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4339, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x433A, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x433B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x433C, 0x81);
    ret += imx390_write_register(vi_pipe, 0x433D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x433E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x433F, 0x81);
    ret += imx390_write_register(vi_pipe, 0x4340, 0x82);
    ret += imx390_write_register(vi_pipe, 0x4341, 0x82);
    ret += imx390_write_register(vi_pipe, 0x4342, 0x82);
    ret += imx390_write_register(vi_pipe, 0x4343, 0x83);
    ret += imx390_write_register(vi_pipe, 0x4344, 0x85);
    ret += imx390_write_register(vi_pipe, 0x4345, 0x85);
    ret += imx390_write_register(vi_pipe, 0x4346, 0x85);
    ret += imx390_write_register(vi_pipe, 0x4347, 0x86);
    ret += imx390_write_register(vi_pipe, 0x4348, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4349, 0x86);
    ret += imx390_write_register(vi_pipe, 0x434A, 0x86);
    ret += imx390_write_register(vi_pipe, 0x434B, 0x87);
    ret += imx390_write_register(vi_pipe, 0x434C, 0x84);
    ret += imx390_write_register(vi_pipe, 0x434D, 0x82);
    ret += imx390_write_register(vi_pipe, 0x434E, 0x82);
    ret += imx390_write_register(vi_pipe, 0x434F, 0x83);
    ret += imx390_write_register(vi_pipe, 0x4350, 0x81);
    ret += imx390_write_register(vi_pipe, 0x4351, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4352, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4353, 0x81);
    ret += imx390_write_register(vi_pipe, 0x4354, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4355, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x4356, 0x7F);
    ret += imx390_write_register(vi_pipe, 0x4357, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4358, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4359, 0x80);
    ret += imx390_write_register(vi_pipe, 0x435A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x435B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x435C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x435D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x435E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x435F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4360, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4361, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4362, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4363, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4364, 0x82);
    ret += imx390_write_register(vi_pipe, 0x4365, 0x82);
    ret += imx390_write_register(vi_pipe, 0x4366, 0x82);
    ret += imx390_write_register(vi_pipe, 0x4367, 0x83);
    ret += imx390_write_register(vi_pipe, 0x4368, 0x87);
    ret += imx390_write_register(vi_pipe, 0x4369, 0x86);
    ret += imx390_write_register(vi_pipe, 0x436A, 0x86);
    ret += imx390_write_register(vi_pipe, 0x436B, 0x87);
    ret += imx390_write_register(vi_pipe, 0x436C, 0x89);
    ret += imx390_write_register(vi_pipe, 0x436D, 0x87);
    ret += imx390_write_register(vi_pipe, 0x436E, 0x87);
    ret += imx390_write_register(vi_pipe, 0x436F, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4370, 0x85);
    ret += imx390_write_register(vi_pipe, 0x4371, 0x83);
    ret += imx390_write_register(vi_pipe, 0x4372, 0x83);
    ret += imx390_write_register(vi_pipe, 0x4373, 0x84);
    ret += imx390_write_register(vi_pipe, 0x4374, 0x82);
    ret += imx390_write_register(vi_pipe, 0x4375, 0x81);
    ret += imx390_write_register(vi_pipe, 0x4376, 0x81);
    ret += imx390_write_register(vi_pipe, 0x4377, 0x81);
    ret += imx390_write_register(vi_pipe, 0x4378, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4379, 0x80);
    ret += imx390_write_register(vi_pipe, 0x437A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x437B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x437C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x437D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x437E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x437F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4380, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4381, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4382, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4383, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4384, 0x81);
    ret += imx390_write_register(vi_pipe, 0x4385, 0x81);
    ret += imx390_write_register(vi_pipe, 0x4386, 0x81);
    ret += imx390_write_register(vi_pipe, 0x4387, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4388, 0x83);
    ret += imx390_write_register(vi_pipe, 0x4389, 0x83);
    ret += imx390_write_register(vi_pipe, 0x438A, 0x83);
    ret += imx390_write_register(vi_pipe, 0x438B, 0x83);
    ret += imx390_write_register(vi_pipe, 0x438C, 0x87);
    ret += imx390_write_register(vi_pipe, 0x438D, 0x87);
    ret += imx390_write_register(vi_pipe, 0x438E, 0x86);
    ret += imx390_write_register(vi_pipe, 0x438F, 0x86);
    ret += imx390_write_register(vi_pipe, 0x4390, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x4391, 0x88);
    ret += imx390_write_register(vi_pipe, 0x4392, 0x89);
    ret += imx390_write_register(vi_pipe, 0x4393, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x4394, 0x87);
    ret += imx390_write_register(vi_pipe, 0x4395, 0x85);
    ret += imx390_write_register(vi_pipe, 0x4396, 0x85);
    ret += imx390_write_register(vi_pipe, 0x4397, 0x86);
    ret += imx390_write_register(vi_pipe, 0x4398, 0x83);
    ret += imx390_write_register(vi_pipe, 0x4399, 0x82);
    ret += imx390_write_register(vi_pipe, 0x439A, 0x82);
    ret += imx390_write_register(vi_pipe, 0x439B, 0x83);
    ret += imx390_write_register(vi_pipe, 0x439C, 0x81);
    ret += imx390_write_register(vi_pipe, 0x439D, 0x81);
    ret += imx390_write_register(vi_pipe, 0x439E, 0x81);
    ret += imx390_write_register(vi_pipe, 0x439F, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43A0, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43A1, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43A2, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43A3, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43A4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x43A5, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43A6, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43A7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x43A8, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43A9, 0x82);
    ret += imx390_write_register(vi_pipe, 0x43AA, 0x82);
    ret += imx390_write_register(vi_pipe, 0x43AB, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43AC, 0x84);
    ret += imx390_write_register(vi_pipe, 0x43AD, 0x84);
    ret += imx390_write_register(vi_pipe, 0x43AE, 0x84);
    ret += imx390_write_register(vi_pipe, 0x43AF, 0x84);
    ret += imx390_write_register(vi_pipe, 0x43B0, 0x88);
    ret += imx390_write_register(vi_pipe, 0x43B1, 0x88);
    ret += imx390_write_register(vi_pipe, 0x43B2, 0x88);
    ret += imx390_write_register(vi_pipe, 0x43B3, 0x88);
    ret += imx390_write_register(vi_pipe, 0x43B4, 0x8F);
    ret += imx390_write_register(vi_pipe, 0x43B5, 0x8B);
    ret += imx390_write_register(vi_pipe, 0x43B6, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x43B7, 0x90);
    ret += imx390_write_register(vi_pipe, 0x43B8, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x43B9, 0x87);
    ret += imx390_write_register(vi_pipe, 0x43BA, 0x88);
    ret += imx390_write_register(vi_pipe, 0x43BB, 0x8B);
    ret += imx390_write_register(vi_pipe, 0x43BC, 0x85);
    ret += imx390_write_register(vi_pipe, 0x43BD, 0x84);
    ret += imx390_write_register(vi_pipe, 0x43BE, 0x84);
    ret += imx390_write_register(vi_pipe, 0x43BF, 0x85);
    ret += imx390_write_register(vi_pipe, 0x43C0, 0x83);
    ret += imx390_write_register(vi_pipe, 0x43C1, 0x82);
    ret += imx390_write_register(vi_pipe, 0x43C2, 0x83);
    ret += imx390_write_register(vi_pipe, 0x43C3, 0x83);
    ret += imx390_write_register(vi_pipe, 0x43C4, 0x82);
    ret += imx390_write_register(vi_pipe, 0x43C5, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43C6, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43C7, 0x82);
    ret += imx390_write_register(vi_pipe, 0x43C8, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43C9, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43CA, 0x81);
    ret += imx390_write_register(vi_pipe, 0x43CB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x43CC, 0x83);
    ret += imx390_write_register(vi_pipe, 0x43CD, 0x83);
    ret += imx390_write_register(vi_pipe, 0x43CE, 0x82);
    ret += imx390_write_register(vi_pipe, 0x43CF, 0x82);
    ret += imx390_write_register(vi_pipe, 0x43D0, 0x86);
    ret += imx390_write_register(vi_pipe, 0x43D1, 0x85);
    ret += imx390_write_register(vi_pipe, 0x43D2, 0x85);
    ret += imx390_write_register(vi_pipe, 0x43D3, 0x86);
    ret += imx390_write_register(vi_pipe, 0x43D4, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x43D5, 0x89);
    ret += imx390_write_register(vi_pipe, 0x43D6, 0x89);
    ret += imx390_write_register(vi_pipe, 0x43D7, 0x89);
    ret += imx390_write_register(vi_pipe, 0x4400, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4401, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4402, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4403, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4404, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4405, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4406, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4407, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4408, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4409, 0x80);
    ret += imx390_write_register(vi_pipe, 0x440A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x440B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x440C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x440D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x440E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x440F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4410, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4411, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4412, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4413, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4414, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4415, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4416, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4417, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4418, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4419, 0x80);
    ret += imx390_write_register(vi_pipe, 0x441A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x441B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x441C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x441D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x441E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x441F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4420, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4421, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4422, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4423, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4424, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4425, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4426, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4427, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4428, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4429, 0x80);
    ret += imx390_write_register(vi_pipe, 0x442A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x442B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x442C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x442D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x442E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x442F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4430, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4431, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4432, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4433, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4434, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4435, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4436, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4437, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4438, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4439, 0x80);
    ret += imx390_write_register(vi_pipe, 0x443A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x443B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x443C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x443D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x443E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x443F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4440, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4441, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4442, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4443, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4444, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4445, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4446, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4447, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4448, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4449, 0x80);
    ret += imx390_write_register(vi_pipe, 0x444A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x444B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x444C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x444D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x444E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x444F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4450, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4451, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4452, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4453, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4454, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4455, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4456, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4457, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4458, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4459, 0x80);
    ret += imx390_write_register(vi_pipe, 0x445A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x445B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x445C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x445D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x445E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x445F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4460, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4461, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4462, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4463, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4464, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4465, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4466, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4467, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4468, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4469, 0x80);
    ret += imx390_write_register(vi_pipe, 0x446A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x446B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x446C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x446D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x446E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x446F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4470, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4471, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4472, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4473, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4474, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4475, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4476, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4477, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4478, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4479, 0x80);
    ret += imx390_write_register(vi_pipe, 0x447A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x447B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x447C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x447D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x447E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x447F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4480, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4481, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4482, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4483, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4484, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4485, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4486, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4487, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4488, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4489, 0x80);
    ret += imx390_write_register(vi_pipe, 0x448A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x448B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x448C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x448D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x448E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x448F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4490, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4491, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4492, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4493, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4494, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4495, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4496, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4497, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4498, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4499, 0x80);
    ret += imx390_write_register(vi_pipe, 0x449A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x449B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x449C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x449D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x449E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x449F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44A0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44A1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44A2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44A3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44A4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44A5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44A6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44A7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44A8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44A9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44AA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44AB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44AC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44AD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44AE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44AF, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44B0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44B1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44B2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44B3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44B4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44B5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44B6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44B7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44B8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44B9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44BA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44BB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44BC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44BD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44BE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44BF, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44C0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44C1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44C2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44C3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44C4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44C5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44C6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44C7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44C8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44C9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44CA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44CB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44CC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44CD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44CE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44CF, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44D0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44D1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44D2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44D3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44D4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44D5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44D6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x44D7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4500, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4501, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4502, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4503, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4504, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4505, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4506, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4507, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4508, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4509, 0x80);
    ret += imx390_write_register(vi_pipe, 0x450A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x450B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x450C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x450D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x450E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x450F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4510, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4511, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4512, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4513, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4514, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4515, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4516, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4517, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4518, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4519, 0x80);
    ret += imx390_write_register(vi_pipe, 0x451A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x451B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x451C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x451D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x451E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x451F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4520, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4521, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4522, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4523, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4524, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4525, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4526, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4527, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4528, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4529, 0x80);
    ret += imx390_write_register(vi_pipe, 0x452A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x452B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x452C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x452D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x452E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x452F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4530, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4531, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4532, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4533, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4534, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4535, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4536, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4537, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4538, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4539, 0x80);
    ret += imx390_write_register(vi_pipe, 0x453A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x453B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x453C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x453D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x453E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x453F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4540, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4541, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4542, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4543, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4544, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4545, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4546, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4547, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4548, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4549, 0x80);
    ret += imx390_write_register(vi_pipe, 0x454A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x454B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x454C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x454D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x454E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x454F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4550, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4551, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4552, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4553, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4554, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4555, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4556, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4557, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4558, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4559, 0x80);
    ret += imx390_write_register(vi_pipe, 0x455A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x455B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x455C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x455D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x455E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x455F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4560, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4561, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4562, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4563, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4564, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4565, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4566, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4567, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4568, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4569, 0x80);
    ret += imx390_write_register(vi_pipe, 0x456A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x456B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x456C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x456D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x456E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x456F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4570, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4571, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4572, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4573, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4574, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4575, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4576, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4577, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4578, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4579, 0x80);
    ret += imx390_write_register(vi_pipe, 0x457A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x457B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x457C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x457D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x457E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x457F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4580, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4581, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4582, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4583, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4584, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4585, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4586, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4587, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4588, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4589, 0x80);
    ret += imx390_write_register(vi_pipe, 0x458A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x458B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x458C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x458D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x458E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x458F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4590, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4591, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4592, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4593, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4594, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4595, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4596, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4597, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4598, 0x80);
    ret += imx390_write_register(vi_pipe, 0x4599, 0x80);
    ret += imx390_write_register(vi_pipe, 0x459A, 0x80);
    ret += imx390_write_register(vi_pipe, 0x459B, 0x80);
    ret += imx390_write_register(vi_pipe, 0x459C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x459D, 0x80);
    ret += imx390_write_register(vi_pipe, 0x459E, 0x80);
    ret += imx390_write_register(vi_pipe, 0x459F, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45A0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45A1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45A2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45A3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45A4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45A5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45A6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45A7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45A8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45A9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45AA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45AB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45AC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45AD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45AE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45AF, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45B0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45B1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45B2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45B3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45B4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45B5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45B6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45B7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45B8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45B9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45BA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45BB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45BC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45BD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45BE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45BF, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45C0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45C1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45C2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45C3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45C4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45C5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45C6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45C7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45C8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45C9, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45CA, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45CB, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45CC, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45CD, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45CE, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45CF, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45D0, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45D1, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45D2, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45D3, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45D4, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45D5, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45D6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x45D7, 0x80);
    ret += imx390_write_register(vi_pipe, 0x7000, 0xAB);
    ret += imx390_write_register(vi_pipe, 0x7001, 0xBA);
    ret += imx390_write_register(vi_pipe, 0x7002, 0x40);
    ret += imx390_write_register(vi_pipe, 0x7003, 0x02);
    ret += imx390_write_register(vi_pipe, 0x7004, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7005, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7006, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7007, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7008, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7009, 0x00);
    ret += imx390_write_register(vi_pipe, 0x700A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x700B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x700C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x700D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x700E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x700F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7010, 0x55);
    ret += imx390_write_register(vi_pipe, 0x7011, 0x88);
    ret += imx390_write_register(vi_pipe, 0x7012, 0x40);
    ret += imx390_write_register(vi_pipe, 0x7013, 0x01);
    ret += imx390_write_register(vi_pipe, 0x7014, 0x72);
    ret += imx390_write_register(vi_pipe, 0x7015, 0xF1);
    ret += imx390_write_register(vi_pipe, 0x7016, 0x02);
    ret += imx390_write_register(vi_pipe, 0x7017, 0xF8);
    ret += imx390_write_register(vi_pipe, 0x7018, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7019, 0x00);
    ret += imx390_write_register(vi_pipe, 0x701A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x701B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x701C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x701D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x701E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x701F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7020, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7021, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7022, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7023, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7024, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7025, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7026, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7027, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7028, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7029, 0x00);
    ret += imx390_write_register(vi_pipe, 0x702A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x702B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x702C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x702D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x702E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x702F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7030, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7031, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7032, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7033, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7034, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7035, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7036, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7037, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7038, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7039, 0x00);
    ret += imx390_write_register(vi_pipe, 0x703A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x703B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x703C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x703D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x703E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x703F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7040, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7041, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7042, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7043, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7044, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7045, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7046, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7047, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7048, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7049, 0x00);
    ret += imx390_write_register(vi_pipe, 0x704A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x704B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x704C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x704D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x704E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x704F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7050, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7051, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7052, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7053, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7054, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7055, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7056, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7057, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7058, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7059, 0x00);
    ret += imx390_write_register(vi_pipe, 0x705A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x705B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x705C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x705D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x705E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x705F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7060, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7061, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7062, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7063, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7064, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7065, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7066, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7067, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7068, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7069, 0x00);
    ret += imx390_write_register(vi_pipe, 0x706A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x706B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x706C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x706D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x706E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x706F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7070, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7071, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7072, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7073, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7074, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7075, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7076, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7077, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7078, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7079, 0x00);
    ret += imx390_write_register(vi_pipe, 0x707A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x707B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x707C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x707D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x707E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x707F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7080, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7081, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7082, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7083, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7084, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7085, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7086, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7087, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7088, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7089, 0x00);
    ret += imx390_write_register(vi_pipe, 0x708A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x708B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x708C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x708D, 0x00);
    ret += imx390_write_register(vi_pipe, 0x708E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x708F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7090, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7091, 0xF0);
    ret += imx390_write_register(vi_pipe, 0x7092, 0x02);
    ret += imx390_write_register(vi_pipe, 0x7093, 0xF8);
    ret += imx390_write_register(vi_pipe, 0x7094, 0x8D);
    ret += imx390_write_register(vi_pipe, 0x7095, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x7096, 0xFA);
    ret += imx390_write_register(vi_pipe, 0x7097, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x7098, 0xF0);
    ret += imx390_write_register(vi_pipe, 0x7099, 0xB5);
    ret += imx390_write_register(vi_pipe, 0x709A, 0x04);
    ret += imx390_write_register(vi_pipe, 0x709B, 0x46);
    ret += imx390_write_register(vi_pipe, 0x709C, 0x8F);
    ret += imx390_write_register(vi_pipe, 0x709D, 0xB0);
    ret += imx390_write_register(vi_pipe, 0x709E, 0x5F);
    ret += imx390_write_register(vi_pipe, 0x709F, 0x48);
    ret += imx390_write_register(vi_pipe, 0x70A0, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x70A1, 0x90);
    ret += imx390_write_register(vi_pipe, 0x70A2, 0x5F);
    ret += imx390_write_register(vi_pipe, 0x70A3, 0x48);
    ret += imx390_write_register(vi_pipe, 0x70A4, 0x06);
    ret += imx390_write_register(vi_pipe, 0x70A5, 0x90);
    ret += imx390_write_register(vi_pipe, 0x70A6, 0x20);
    ret += imx390_write_register(vi_pipe, 0x70A7, 0x46);
    ret += imx390_write_register(vi_pipe, 0x70A8, 0x34);
    ret += imx390_write_register(vi_pipe, 0x70A9, 0x30);
    ret += imx390_write_register(vi_pipe, 0x70AA, 0x0B);
    ret += imx390_write_register(vi_pipe, 0x70AB, 0x90);
    ret += imx390_write_register(vi_pipe, 0x70AC, 0x5B);
    ret += imx390_write_register(vi_pipe, 0x70AD, 0x48);
    ret += imx390_write_register(vi_pipe, 0x70AE, 0x5A);
    ret += imx390_write_register(vi_pipe, 0x70AF, 0x49);
    ret += imx390_write_register(vi_pipe, 0x70B0, 0x26);
    ret += imx390_write_register(vi_pipe, 0x70B1, 0x46);
    ret += imx390_write_register(vi_pipe, 0x70B2, 0x66);
    ret += imx390_write_register(vi_pipe, 0x70B3, 0x30);
    ret += imx390_write_register(vi_pipe, 0x70B4, 0x3A);
    ret += imx390_write_register(vi_pipe, 0x70B5, 0x31);
    ret += imx390_write_register(vi_pipe, 0x70B6, 0x3C);
    ret += imx390_write_register(vi_pipe, 0x70B7, 0x36);
    ret += imx390_write_register(vi_pipe, 0x70B8, 0x05);
    ret += imx390_write_register(vi_pipe, 0x70B9, 0x90);
    ret += imx390_write_register(vi_pipe, 0x70BA, 0x0A);
    ret += imx390_write_register(vi_pipe, 0x70BB, 0x30);
    ret += imx390_write_register(vi_pipe, 0x70BC, 0x04);
    ret += imx390_write_register(vi_pipe, 0x70BD, 0x90);
    ret += imx390_write_register(vi_pipe, 0x70BE, 0x59);
    ret += imx390_write_register(vi_pipe, 0x70BF, 0x48);
    ret += imx390_write_register(vi_pipe, 0x70C0, 0x55);
    ret += imx390_write_register(vi_pipe, 0x70C1, 0x4A);
    ret += imx390_write_register(vi_pipe, 0x70C2, 0x40);
    ret += imx390_write_register(vi_pipe, 0x70C3, 0x6E);
    ret += imx390_write_register(vi_pipe, 0x70C4, 0xC0);
    ret += imx390_write_register(vi_pipe, 0x70C5, 0x07);
    ret += imx390_write_register(vi_pipe, 0x70C6, 0x7D);
    ret += imx390_write_register(vi_pipe, 0x70C7, 0xD1);
    ret += imx390_write_register(vi_pipe, 0x70C8, 0x17);
    ret += imx390_write_register(vi_pipe, 0x70C9, 0x88);
    ret += imx390_write_register(vi_pipe, 0x70CA, 0x0A);
    ret += imx390_write_register(vi_pipe, 0x70CB, 0x5E);
    ret += imx390_write_register(vi_pipe, 0x70CC, 0x0D);
    ret += imx390_write_register(vi_pipe, 0x70CD, 0x92);
    ret += imx390_write_register(vi_pipe, 0x70CE, 0x53);
    ret += imx390_write_register(vi_pipe, 0x70CF, 0x49);
    ret += imx390_write_register(vi_pipe, 0x70D0, 0x55);
    ret += imx390_write_register(vi_pipe, 0x70D1, 0x48);
    ret += imx390_write_register(vi_pipe, 0x70D2, 0x94);
    ret += imx390_write_register(vi_pipe, 0x70D3, 0x31);
    ret += imx390_write_register(vi_pipe, 0x70D4, 0x89);
    ret += imx390_write_register(vi_pipe, 0x70D5, 0x6B);
    ret += imx390_write_register(vi_pipe, 0x70D6, 0x80);
    ret += imx390_write_register(vi_pipe, 0x70D7, 0x68);
    ret += imx390_write_register(vi_pipe, 0x70D8, 0x09);
    ret += imx390_write_register(vi_pipe, 0x70D9, 0x02);
    ret += imx390_write_register(vi_pipe, 0x70DA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x70DB, 0x03);
    ret += imx390_write_register(vi_pipe, 0x70DC, 0x09);
    ret += imx390_write_register(vi_pipe, 0x70DD, 0x0E);
    ret += imx390_write_register(vi_pipe, 0x70DE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x70DF, 0x0B);
    ret += imx390_write_register(vi_pipe, 0x70E0, 0x49);
    ret += imx390_write_register(vi_pipe, 0x70E1, 0x1C);
    ret += imx390_write_register(vi_pipe, 0x70E2, 0x48);
    ret += imx390_write_register(vi_pipe, 0x70E3, 0x43);
    ret += imx390_write_register(vi_pipe, 0x70E4, 0x4D);
    ret += imx390_write_register(vi_pipe, 0x70E5, 0x49);
    ret += imx390_write_register(vi_pipe, 0x70E6, 0x6C);
    ret += imx390_write_register(vi_pipe, 0x70E7, 0x39);
    ret += imx390_write_register(vi_pipe, 0x70E8, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x70E9, 0x6A);
    ret += imx390_write_register(vi_pipe, 0x70EA, 0x07);
    ret += imx390_write_register(vi_pipe, 0x70EB, 0x92);
    ret += imx390_write_register(vi_pipe, 0x70EC, 0xCA);
    ret += imx390_write_register(vi_pipe, 0x70ED, 0x6A);
    ret += imx390_write_register(vi_pipe, 0x70EE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x70EF, 0x21);
    ret += imx390_write_register(vi_pipe, 0x70F0, 0xC9);
    ret += imx390_write_register(vi_pipe, 0x70F1, 0x43);
    ret += imx390_write_register(vi_pipe, 0x70F2, 0x03);
    ret += imx390_write_register(vi_pipe, 0x70F3, 0x92);
    ret += imx390_write_register(vi_pipe, 0x70F4, 0x00);
    ret += imx390_write_register(vi_pipe, 0x70F5, 0x22);
    ret += imx390_write_register(vi_pipe, 0x70F6, 0x00);
    ret += imx390_write_register(vi_pipe, 0x70F7, 0x91);
    ret += imx390_write_register(vi_pipe, 0x70F8, 0x01);
    ret += imx390_write_register(vi_pipe, 0x70F9, 0x92);
    ret += imx390_write_register(vi_pipe, 0x70FA, 0x39);
    ret += imx390_write_register(vi_pipe, 0x70FB, 0x46);
    ret += imx390_write_register(vi_pipe, 0x70FC, 0x8F);
    ret += imx390_write_register(vi_pipe, 0x70FD, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x70FE, 0xCE);
    ret += imx390_write_register(vi_pipe, 0x70FF, 0xFB);
    ret += imx390_write_register(vi_pipe, 0x7100, 0x01);
    ret += imx390_write_register(vi_pipe, 0x7101, 0x22);
    ret += imx390_write_register(vi_pipe, 0x7102, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7103, 0x23);
    ret += imx390_write_register(vi_pipe, 0x7104, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x7105, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x7106, 0x02);
    ret += imx390_write_register(vi_pipe, 0x7107, 0xFA);
    ret += imx390_write_register(vi_pipe, 0x7108, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7109, 0x21);
    ret += imx390_write_register(vi_pipe, 0x710A, 0x05);
    ret += imx390_write_register(vi_pipe, 0x710B, 0x46);
    ret += imx390_write_register(vi_pipe, 0x710C, 0x01);
    ret += imx390_write_register(vi_pipe, 0x710D, 0x91);
    ret += imx390_write_register(vi_pipe, 0x710E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x710F, 0x90);
    ret += imx390_write_register(vi_pipe, 0x7110, 0x39);
    ret += imx390_write_register(vi_pipe, 0x7111, 0x46);
    ret += imx390_write_register(vi_pipe, 0x7112, 0x07);
    ret += imx390_write_register(vi_pipe, 0x7113, 0x98);
    ret += imx390_write_register(vi_pipe, 0x7114, 0x8F);
    ret += imx390_write_register(vi_pipe, 0x7115, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x7116, 0xC2);
    ret += imx390_write_register(vi_pipe, 0x7117, 0xFB);
    ret += imx390_write_register(vi_pipe, 0x7118, 0x0D);
    ret += imx390_write_register(vi_pipe, 0x7119, 0x9A);
    ret += imx390_write_register(vi_pipe, 0x711A, 0xD3);
    ret += imx390_write_register(vi_pipe, 0x711B, 0x17);
    ret += imx390_write_register(vi_pipe, 0x711C, 0x80);
    ret += imx390_write_register(vi_pipe, 0x711D, 0x18);
    ret += imx390_write_register(vi_pipe, 0x711E, 0x59);
    ret += imx390_write_register(vi_pipe, 0x711F, 0x41);
    ret += imx390_write_register(vi_pipe, 0x7120, 0x01);
    ret += imx390_write_register(vi_pipe, 0x7121, 0x22);
    ret += imx390_write_register(vi_pipe, 0x7122, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7123, 0x23);
    ret += imx390_write_register(vi_pipe, 0x7124, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x7125, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x7126, 0xCD);
    ret += imx390_write_register(vi_pipe, 0x7127, 0xF9);
    ret += imx390_write_register(vi_pipe, 0x7128, 0x07);
    ret += imx390_write_register(vi_pipe, 0x7129, 0x90);
    ret += imx390_write_register(vi_pipe, 0x712A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x712B, 0x20);
    ret += imx390_write_register(vi_pipe, 0x712C, 0x01);
    ret += imx390_write_register(vi_pipe, 0x712D, 0x90);
    ret += imx390_write_register(vi_pipe, 0x712E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x712F, 0x95);
    ret += imx390_write_register(vi_pipe, 0x7130, 0x39);
    ret += imx390_write_register(vi_pipe, 0x7131, 0x46);
    ret += imx390_write_register(vi_pipe, 0x7132, 0x03);
    ret += imx390_write_register(vi_pipe, 0x7133, 0x98);
    ret += imx390_write_register(vi_pipe, 0x7134, 0x8F);
    ret += imx390_write_register(vi_pipe, 0x7135, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x7136, 0xB2);
    ret += imx390_write_register(vi_pipe, 0x7137, 0xFB);
    ret += imx390_write_register(vi_pipe, 0x7138, 0x01);
    ret += imx390_write_register(vi_pipe, 0x7139, 0x22);
    ret += imx390_write_register(vi_pipe, 0x713A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x713B, 0x23);
    ret += imx390_write_register(vi_pipe, 0x713C, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x713D, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x713E, 0xE6);
    ret += imx390_write_register(vi_pipe, 0x713F, 0xF9);
    ret += imx390_write_register(vi_pipe, 0x7140, 0x02);
    ret += imx390_write_register(vi_pipe, 0x7141, 0x46);
    ret += imx390_write_register(vi_pipe, 0x7142, 0x07);
    ret += imx390_write_register(vi_pipe, 0x7143, 0x98);
    ret += imx390_write_register(vi_pipe, 0x7144, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7145, 0x23);
    ret += imx390_write_register(vi_pipe, 0x7146, 0x81);
    ret += imx390_write_register(vi_pipe, 0x7147, 0x0B);
    ret += imx390_write_register(vi_pipe, 0x7148, 0x80);
    ret += imx390_write_register(vi_pipe, 0x7149, 0x04);
    ret += imx390_write_register(vi_pipe, 0x714A, 0x7A);
    ret += imx390_write_register(vi_pipe, 0x714B, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x714C, 0x54);
    ret += imx390_write_register(vi_pipe, 0x714D, 0xF8);
    ret += imx390_write_register(vi_pipe, 0x714E, 0x37);
    ret += imx390_write_register(vi_pipe, 0x714F, 0x4A);
    ret += imx390_write_register(vi_pipe, 0x7150, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7151, 0x23);
    ret += imx390_write_register(vi_pipe, 0x7152, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7153, 0x92);
    ret += imx390_write_register(vi_pipe, 0x7154, 0x01);
    ret += imx390_write_register(vi_pipe, 0x7155, 0x93);
    ret += imx390_write_register(vi_pipe, 0x7156, 0x01);
    ret += imx390_write_register(vi_pipe, 0x7157, 0x22);
    ret += imx390_write_register(vi_pipe, 0x7158, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x7159, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x715A, 0xD8);
    ret += imx390_write_register(vi_pipe, 0x715B, 0xF9);
    ret += imx390_write_register(vi_pipe, 0x715C, 0x05);
    ret += imx390_write_register(vi_pipe, 0x715D, 0x46);
    ret += imx390_write_register(vi_pipe, 0x715E, 0x60);
    ret += imx390_write_register(vi_pipe, 0x715F, 0x68);
    ret += imx390_write_register(vi_pipe, 0x7160, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7161, 0x23);
    ret += imx390_write_register(vi_pipe, 0x7162, 0x01);
    ret += imx390_write_register(vi_pipe, 0x7163, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x7164, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7165, 0x04);
    ret += imx390_write_register(vi_pipe, 0x7166, 0xE2);
    ret += imx390_write_register(vi_pipe, 0x7167, 0x68);
    ret += imx390_write_register(vi_pipe, 0x7168, 0x7A);
    ret += imx390_write_register(vi_pipe, 0x7169, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x716A, 0x45);
    ret += imx390_write_register(vi_pipe, 0x716B, 0xF8);
    ret += imx390_write_register(vi_pipe, 0x716C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x716D, 0x22);
    ret += imx390_write_register(vi_pipe, 0x716E, 0xD2);
    ret += imx390_write_register(vi_pipe, 0x716F, 0x43);
    ret += imx390_write_register(vi_pipe, 0x7170, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7171, 0x23);
    ret += imx390_write_register(vi_pipe, 0x7172, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7173, 0x92);
    ret += imx390_write_register(vi_pipe, 0x7174, 0x01);
    ret += imx390_write_register(vi_pipe, 0x7175, 0x93);
    ret += imx390_write_register(vi_pipe, 0x7176, 0x1A);
    ret += imx390_write_register(vi_pipe, 0x7177, 0x46);
    ret += imx390_write_register(vi_pipe, 0x7178, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x7179, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x717A, 0xC8);
    ret += imx390_write_register(vi_pipe, 0x717B, 0xF9);
    ret += imx390_write_register(vi_pipe, 0x717C, 0x29);
    ret += imx390_write_register(vi_pipe, 0x717D, 0x46);
    ret += imx390_write_register(vi_pipe, 0x717E, 0x8F);
    ret += imx390_write_register(vi_pipe, 0x717F, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x7180, 0x8D);
    ret += imx390_write_register(vi_pipe, 0x7181, 0xFB);
    ret += imx390_write_register(vi_pipe, 0x7182, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x7183, 0x03);
    ret += imx390_write_register(vi_pipe, 0x7184, 0x80);
    ret += imx390_write_register(vi_pipe, 0x7185, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x7186, 0x10);
    ret += imx390_write_register(vi_pipe, 0x7187, 0x43);
    ret += imx390_write_register(vi_pipe, 0x7188, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7189, 0x22);
    ret += imx390_write_register(vi_pipe, 0x718A, 0xD2);
    ret += imx390_write_register(vi_pipe, 0x718B, 0x43);
    ret += imx390_write_register(vi_pipe, 0x718C, 0x00);
    ret += imx390_write_register(vi_pipe, 0x718D, 0x23);
    ret += imx390_write_register(vi_pipe, 0x718E, 0x00);
    ret += imx390_write_register(vi_pipe, 0x718F, 0x92);
    ret += imx390_write_register(vi_pipe, 0x7190, 0x89);
    ret += imx390_write_register(vi_pipe, 0x7191, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x7192, 0x01);
    ret += imx390_write_register(vi_pipe, 0x7193, 0x93);
    ret += imx390_write_register(vi_pipe, 0x7194, 0x1A);
    ret += imx390_write_register(vi_pipe, 0x7195, 0x46);
    ret += imx390_write_register(vi_pipe, 0x7196, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x7197, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x7198, 0xB9);
    ret += imx390_write_register(vi_pipe, 0x7199, 0xF9);
    ret += imx390_write_register(vi_pipe, 0x719A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x719B, 0x24);
    ret += imx390_write_register(vi_pipe, 0x719C, 0x03);
    ret += imx390_write_register(vi_pipe, 0x719D, 0x90);
    ret += imx390_write_register(vi_pipe, 0x719E, 0x0C);
    ret += imx390_write_register(vi_pipe, 0x719F, 0x98);
    ret += imx390_write_register(vi_pipe, 0x71A0, 0x61);
    ret += imx390_write_register(vi_pipe, 0x71A1, 0x00);
    ret += imx390_write_register(vi_pipe, 0x71A2, 0x45);
    ret += imx390_write_register(vi_pipe, 0x71A3, 0x5A);
    ret += imx390_write_register(vi_pipe, 0x71A4, 0x06);
    ret += imx390_write_register(vi_pipe, 0x71A5, 0x98);
    ret += imx390_write_register(vi_pipe, 0x71A6, 0x22);
    ret += imx390_write_register(vi_pipe, 0x71A7, 0x4A);
    ret += imx390_write_register(vi_pipe, 0x71A8, 0x40);
    ret += imx390_write_register(vi_pipe, 0x71A9, 0x5A);
    ret += imx390_write_register(vi_pipe, 0x71AA, 0x00);
    ret += imx390_write_register(vi_pipe, 0x71AB, 0x21);
    ret += imx390_write_register(vi_pipe, 0x71AC, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x71AD, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x71AE, 0xBE);
    ret += imx390_write_register(vi_pipe, 0x71AF, 0xF9);
    ret += imx390_write_register(vi_pipe, 0x71B0, 0x07);
    ret += imx390_write_register(vi_pipe, 0x71B1, 0x46);
    ret += imx390_write_register(vi_pipe, 0x71B2, 0x28);
    ret += imx390_write_register(vi_pipe, 0x71B3, 0x46);
    ret += imx390_write_register(vi_pipe, 0x71B4, 0x03);
    ret += imx390_write_register(vi_pipe, 0x71B5, 0x99);
    ret += imx390_write_register(vi_pipe, 0x71B6, 0x8F);
    ret += imx390_write_register(vi_pipe, 0x71B7, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x71B8, 0x71);
    ret += imx390_write_register(vi_pipe, 0x71B9, 0xFB);
    ret += imx390_write_register(vi_pipe, 0x71BA, 0x3A);
    ret += imx390_write_register(vi_pipe, 0x71BB, 0x46);
    ret += imx390_write_register(vi_pipe, 0x71BC, 0x00);
    ret += imx390_write_register(vi_pipe, 0x71BD, 0x23);
    ret += imx390_write_register(vi_pipe, 0x71BE, 0x79);
    ret += imx390_write_register(vi_pipe, 0x71BF, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x71C0, 0xCA);
    ret += imx390_write_register(vi_pipe, 0x71C1, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x71C2, 0x00);
    ret += imx390_write_register(vi_pipe, 0x71C3, 0xE0);
    ret += imx390_write_register(vi_pipe, 0x71C4, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x71C5, 0xE0);
    ret += imx390_write_register(vi_pipe, 0x71C6, 0x8A);
    ret += imx390_write_register(vi_pipe, 0x71C7, 0x02);
    ret += imx390_write_register(vi_pipe, 0x71C8, 0x80);
    ret += imx390_write_register(vi_pipe, 0x71C9, 0x0D);
    ret += imx390_write_register(vi_pipe, 0x71CA, 0x10);
    ret += imx390_write_register(vi_pipe, 0x71CB, 0x43);
    ret += imx390_write_register(vi_pipe, 0x71CC, 0x19);
    ret += imx390_write_register(vi_pipe, 0x71CD, 0x4A);
    ret += imx390_write_register(vi_pipe, 0x71CE, 0x00);
    ret += imx390_write_register(vi_pipe, 0x71CF, 0x23);
    ret += imx390_write_register(vi_pipe, 0x71D0, 0x00);
    ret += imx390_write_register(vi_pipe, 0x71D1, 0x92);
    ret += imx390_write_register(vi_pipe, 0x71D2, 0x89);
    ret += imx390_write_register(vi_pipe, 0x71D3, 0x0D);
    ret += imx390_write_register(vi_pipe, 0x71D4, 0x01);
    ret += imx390_write_register(vi_pipe, 0x71D5, 0x93);
    ret += imx390_write_register(vi_pipe, 0x71D6, 0x40);
    ret += imx390_write_register(vi_pipe, 0x71D7, 0x22);
    ret += imx390_write_register(vi_pipe, 0x71D8, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x71D9, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x71DA, 0x98);
    ret += imx390_write_register(vi_pipe, 0x71DB, 0xF9);
    ret += imx390_write_register(vi_pipe, 0x71DC, 0xA1);
    ret += imx390_write_register(vi_pipe, 0x71DD, 0x00);
    ret += imx390_write_register(vi_pipe, 0x71DE, 0x64);
    ret += imx390_write_register(vi_pipe, 0x71DF, 0x1C);
    ret += imx390_write_register(vi_pipe, 0x71E0, 0x70);
    ret += imx390_write_register(vi_pipe, 0x71E1, 0x50);
    ret += imx390_write_register(vi_pipe, 0x71E2, 0x04);
    ret += imx390_write_register(vi_pipe, 0x71E3, 0x2C);
    ret += imx390_write_register(vi_pipe, 0x71E4, 0xDB);
    ret += imx390_write_register(vi_pipe, 0x71E5, 0xD3);
    ret += imx390_write_register(vi_pipe, 0x71E6, 0x14);
    ret += imx390_write_register(vi_pipe, 0x71E7, 0x4D);
    ret += imx390_write_register(vi_pipe, 0x71E8, 0x00);
    ret += imx390_write_register(vi_pipe, 0x71E9, 0x24);
    ret += imx390_write_register(vi_pipe, 0x71EA, 0x0B);
    ret += imx390_write_register(vi_pipe, 0x71EB, 0x98);
    ret += imx390_write_register(vi_pipe, 0x71EC, 0x67);
    ret += imx390_write_register(vi_pipe, 0x71ED, 0x00);
    ret += imx390_write_register(vi_pipe, 0x71EE, 0xC0);
    ret += imx390_write_register(vi_pipe, 0x71EF, 0x5B);
    ret += imx390_write_register(vi_pipe, 0x71F0, 0x2A);
    ret += imx390_write_register(vi_pipe, 0x71F1, 0x46);
    ret += imx390_write_register(vi_pipe, 0x71F2, 0x40);
    ret += imx390_write_register(vi_pipe, 0x71F3, 0x21);
    ret += imx390_write_register(vi_pipe, 0x71F4, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x71F5, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x71F6, 0x9A);
    ret += imx390_write_register(vi_pipe, 0x71F7, 0xF9);
    ret += imx390_write_register(vi_pipe, 0x71F8, 0x05);
    ret += imx390_write_register(vi_pipe, 0x71F9, 0x99);
    ret += imx390_write_register(vi_pipe, 0x71FA, 0x0E);
    ret += imx390_write_register(vi_pipe, 0x71FB, 0x4A);
    ret += imx390_write_register(vi_pipe, 0x71FC, 0xC8);
    ret += imx390_write_register(vi_pipe, 0x71FD, 0x53);
    ret += imx390_write_register(vi_pipe, 0x71FE, 0xA7);
    ret += imx390_write_register(vi_pipe, 0x71FF, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7200, 0xF0);
    ret += imx390_write_register(vi_pipe, 0x7201, 0x59);
    ret += imx390_write_register(vi_pipe, 0x7202, 0x40);
    ret += imx390_write_register(vi_pipe, 0x7203, 0x21);
    ret += imx390_write_register(vi_pipe, 0x7204, 0x8C);
    ret += imx390_write_register(vi_pipe, 0x7205, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x7206, 0x7B);
    ret += imx390_write_register(vi_pipe, 0x7207, 0xF9);
    ret += imx390_write_register(vi_pipe, 0x7208, 0x04);
    ret += imx390_write_register(vi_pipe, 0x7209, 0x99);
    ret += imx390_write_register(vi_pipe, 0x720A, 0x64);
    ret += imx390_write_register(vi_pipe, 0x720B, 0x1C);
    ret += imx390_write_register(vi_pipe, 0x720C, 0xC8);
    ret += imx390_write_register(vi_pipe, 0x720D, 0x51);
    ret += imx390_write_register(vi_pipe, 0x720E, 0x04);
    ret += imx390_write_register(vi_pipe, 0x720F, 0x2C);
    ret += imx390_write_register(vi_pipe, 0x7210, 0xEB);
    ret += imx390_write_register(vi_pipe, 0x7211, 0xD3);
    ret += imx390_write_register(vi_pipe, 0x7212, 0x0F);
    ret += imx390_write_register(vi_pipe, 0x7213, 0xB0);
    ret += imx390_write_register(vi_pipe, 0x7214, 0xF0);
    ret += imx390_write_register(vi_pipe, 0x7215, 0xBD);
    ret += imx390_write_register(vi_pipe, 0x7216, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7217, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7218, 0x76);
    ret += imx390_write_register(vi_pipe, 0x7219, 0x69);
    ret += imx390_write_register(vi_pipe, 0x721A, 0x18);
    ret += imx390_write_register(vi_pipe, 0x721B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x721C, 0xEC);
    ret += imx390_write_register(vi_pipe, 0x721D, 0x58);
    ret += imx390_write_register(vi_pipe, 0x721E, 0x18);
    ret += imx390_write_register(vi_pipe, 0x721F, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7220, 0x38);
    ret += imx390_write_register(vi_pipe, 0x7221, 0x36);
    ret += imx390_write_register(vi_pipe, 0x7222, 0x18);
    ret += imx390_write_register(vi_pipe, 0x7223, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7224, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7225, 0x35);
    ret += imx390_write_register(vi_pipe, 0x7226, 0x18);
    ret += imx390_write_register(vi_pipe, 0x7227, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7228, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7229, 0x20);
    ret += imx390_write_register(vi_pipe, 0x722A, 0x18);
    ret += imx390_write_register(vi_pipe, 0x722B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x722C, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x722D, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x722E, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x722F, 0x3F);
    ret += imx390_write_register(vi_pipe, 0x7230, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x7231, 0x07);
    ret += imx390_write_register(vi_pipe, 0x7232, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7233, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7234, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x7235, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x7236, 0x07);
    ret += imx390_write_register(vi_pipe, 0x7237, 0x00);
    ret += imx390_write_register(vi_pipe, 0x7238, 0xFF);
    ret += imx390_write_register(vi_pipe, 0x7239, 0x1F);
    ret += imx390_write_register(vi_pipe, 0x723A, 0x00);
    ret += imx390_write_register(vi_pipe, 0x723B, 0x00);
    ret += imx390_write_register(vi_pipe, 0x723C, 0x01);
    ret += imx390_write_register(vi_pipe, 0x723D, 0xF6);
    ret += imx390_write_register(vi_pipe, 0x723E, 0x45);
    ret += imx390_write_register(vi_pipe, 0x723F, 0x12);
    ret += imx390_write_register(vi_pipe, 0x2E68, 0x12);
    ret += imx390_write_register(vi_pipe, 0x2E40, 0x1);
    ret += imx390_write_register(vi_pipe, 0x2E41, 0x1);
    ret += imx390_write_register(vi_pipe, 0x3450, 0x0);
    ret += imx390_write_register(vi_pipe, 0x344B, 0x0);
    ret += imx390_write_register(vi_pipe, 0x2E18, 0x0);
    ret += imx390_write_register(vi_pipe, 0x2D94, 0x1);

    delay_ms(200); /* 200ms */

    ret += imx390_write_register(vi_pipe, 0x0000, 0x00); /* standby */
    if (ret != HI_SUCCESS) {
        SNS_ERR_TRACE("write register failed!\n");
        return;
    }
    printf("===IMX390 1080P 30fps 12bit LINE Init OK!===\n");
    return;
}
